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
Uh oh!
There was an error while loading. Please reload this page.
-
In "ast.pyi", I count 124 class definitions that are either class
ASTor a subclass of_SliceASTbinaryopboolopcmpopexcepthandlerexpr_contextexprmodoperatorpatternstmttype_ignoretype_paramunaryopand the class does not have the
@deprecateddecorator.ast.Matchis defined as a subclass ofast.stmt.ast.TypeAliasis 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.Matchandast.TypeAliasare 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