Skip to content

Commit 4358f80

Browse files
committed
fix: remove ast.MatchStar.name class-level default value
1 parent f331d03 commit 4358f80

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Lib/ast.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,8 +155,8 @@ def _format(node, level=0):
155155
not show_empty
156156
and (value is None or value == [])
157157
# Special cases:
158-
# `Constant(value=None)` and `MatchSingleton(value=None)`
159-
and not isinstance(node, (Constant, MatchSingleton))
158+
# `Constant(value=None)` and `MatchSingleton(value=None)` and `MatchStar(name=None)`
159+
and not isinstance(node, (Constant, MatchSingleton, MatchStar))
160160
):
161161
args_buffer.append(repr(value))
162162
continue

Parser/Python.asdl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ module Python
135135
| MatchMapping(expr* keys, pattern* patterns, identifier? rest)
136136
| MatchClass(expr cls, pattern* patterns, identifier* kwd_attrs, pattern* kwd_patterns)
137137

138-
| MatchStar(identifier? name)
138+
| MatchStar(identifier name)
139139
-- The optional "rest" MatchMapping parameter handles capturing extra mapping keys
140140

141141
| MatchAs(pattern? pattern, identifier? name)

0 commit comments

Comments
 (0)