Should ast.Match
and ast.TypeAlias
be exported from "_ast.pyi"?
#1988
Closed
hunterhogan
started this conversation in
General
Replies: 1 comment
-
Yes, this is a bug in the typeshed stub. Feel free to send a PR. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
In "ast.pyi", I count 124 class definitions that are either class
AST
or a subclass of_Slice
AST
binaryop
boolop
cmpop
excepthandler
expr_context
expr
mod
operator
pattern
stmt
type_ignore
type_param
unaryop
and the class does not have the
@deprecated
decorator.ast.Match
is defined as a subclass ofast.stmt
.ast.TypeAlias
is defined as a subclass ofast.stmt
.This suggests they should be imported from "_ast.pyi"
https://github.com/python/typeshed/blob/eec809d049d10a5ae9b88780eab15fe36a9768d7/stdlib/ast.pyi#L33-L35
However,
ast.Match
andast.TypeAlias
are not in "_ast.pyi" and I count 122 classes: 2 less than I expected.https://github.com/python/typeshed/blob/eec809d049d10a5ae9b88780eab15fe36a9768d7/stdlib/_ast.pyi#L113-L131
Beta Was this translation helpful? Give feedback.
All reactions