Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improvement: Add AST subclass constructors #11880

Merged
merged 16 commits into from
May 18, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix: add missing default_value field for Python 3.13
  • Loading branch information
bzoracler authored May 10, 2024
commit b82fc4ef0d51581492e7a70316b846f134c2e558
43 changes: 37 additions & 6 deletions stdlib/_ast.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -1161,20 +1161,51 @@ if sys.version_info >= (3, 12):
def __init__(self, **kwargs: Unpack[_Attributes[int]]) -> None: ...

class TypeVar(type_param):
__match_args__ = ("name", "bound")
if sys.version_info >= (3, 13):
__match_args__ = ("name", "bound", "default_value")
else:
__match_args__ = ("name", "bound")
name: _Identifier
bound: expr | None
def __init__(self, name: _Identifier, bound: expr | None = None, **kwargs: Unpack[_Attributes[int]]) -> None: ...
if sys.version_info >= (3, 13):
default_value: expr | None
def __init__(
self,
name: _Identifier,
bound: expr | None = None,
default_value: expr | None = None,
**kwargs: Unpack[_Attributes[int]],
) -> None: ...
else:
def __init__(self, name: _Identifier, bound: expr | None = None, **kwargs: Unpack[_Attributes[int]]) -> None: ...

class ParamSpec(type_param):
__match_args__ = ("name",)
if sys.version_info >= (3, 13):
__match_args__ = ("name", "default_value")
else:
__match_args__ = ("name",)
name: _Identifier
def __init__(self, name: _Identifier, **kwargs: Unpack[_Attributes[int]]) -> None: ...
if sys.version_info >= (3, 13):
default_value: expr | None
def __init__(
self, name: _Identifier, default_value: expr | None = None, **kwargs: Unpack[_Attributes[int]]
) -> None: ...
else:
def __init__(self, name: _Identifier, **kwargs: Unpack[_Attributes[int]]) -> None: ...

class TypeVarTuple(type_param):
__match_args__ = ("name",)
if sys.version_info >= (3, 13):
__match_args__ = ("name", "default_value")
else:
__match_args__ = ("name",)
name: _Identifier
def __init__(self, name: _Identifier, **kwargs: Unpack[_Attributes[int]]) -> None: ...
if sys.version_info >= (3, 13):
default_value: expr | None
def __init__(
self, name: _Identifier, default_value: expr | None = None, **kwargs: Unpack[_Attributes[int]]
) -> None: ...
else:
def __init__(self, name: _Identifier, **kwargs: Unpack[_Attributes[int]]) -> None: ...

class TypeAlias(stmt):
__match_args__ = ("name", "type_params", "value")
Expand Down