Update symtable stubs for 3.13 and 3.14#12183
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. 🤖🎉 |
This incorporates the changes of the following PRs:
DEF_TYPE_PARAMcompiler flag cpython#120028symtable.Symbol.__repr__correctly reflect the compiler's flags cpython#120099symtable.Class.get_methodsand document its behaviour correctly cpython#120151SyntaxErrormessage for invalid type parameters expressions cpython#119976@JelleZijlstra Should I also write the stubs for
_symtableor should I leave it to the IDEs? (PyCharm generates it automatically from the compiled file, but I don't know for others).