-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
8000
Update symtable
stubs for 3.13 and 3.14
#12183
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
Conversation
(Ah I think the methods were only in 3.13.0b3 actually) |
This comment has been minimized.
This comment has been minimized.
Looks like we'll have to wait for the release of 3.13b3 before adding the new-in-3.13 methods. They exist on 3.13b3 but not on 3.13b2, so stubtest is complaining. I'd be fine with any of the following options:
|
Unless there's a specific reason why someone might want or need to import something from (If anything from |
Yes that's what I was just checking! since
I think it's easier to do that. It's less error-prone (otherwise, I'd need to update the allow_list afterwards, so it's still 2 commits where 1 could have been fine), and more complete IMO (because if someone has 3.14, they would also expect the features from 3.13 since it was written in the docs that this feature was available). And I don't want to change I'll leave it as a draft until the next release.
No, indeed. It's just importing names but since |
I hope it isn't! Since instances of |
Actually, the types are compatible but not the values. We did not change what is returned in 3.12.x but in 3.13, it was decided to change the values. Because the old values were incorrect (semantically speaking, like "TypeVar bound" was returned for the symbol table of a default type parameter value...). And we used an enumeration to avoid a constant string which could not be changed in the future. |
Got it, thanks! (And thanks for the PR!) |
According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
This incorporates the changes of the following PRs:
DEF_TYPE_PARAM
compiler flag cpython#120028symtable.Symbol.__repr__
correctly reflect the compiler's flags cpython#120099symtable.Class.get_methods
and document its behaviour correctly cpython#120151SyntaxError
message for invalid type parameters expressions cpython#119976@JelleZijlstra Should I also write the stubs for
_symtable
or should I leave it to the IDEs? (PyCharm generates it automatically from the compiled file, but I don't know for others).