-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Fix various inheritances #3968
Comments
Would it make sense to add an option to disable these checks, so we could disable them in CI for now? |
Here's the results I get from running @hauntsaninja's branch on the stdlib in 2022. Several have been fixed, but there's also a few new ones:
|
It matches the protocol, but it's not an explicit subclass. As far as I can see, it seems okay to just remove that. related to python#3968
related to #3968 Co-authored-by: Stephen Morton <git@tungol.org>
…nixStreamServer related to python#3968
…mServer related to python#3968
related to python#3968
related to #3968 Co-authored-by: Stephen Morton <git@tungol.org>
They call themselves "decimal.*" at runtime, so move them into decimal.pyi so typshed's name matches. related to python#3968
They call themselves "decimal.*" at runtime, so move them into decimal.pyi so typshed's name matches. related to #3968
Improves the MRO of ExitStack and AsyncExitStack related to python#3968
Improves the MRO of ExitStack and AsyncExitStack related to #3968
This version keeps it simple and clean: No changes to class bodies. The only changes here are moving between files and updating the naming and inheritance. Related to python#3968 and split from python#12740.
improves naming and inheritance for asyncio.Future and asyncio.Task related to python#3968
improves naming and inheritance for asyncio.Future and asyncio.Task related to #3968
Methods are passed through at runtime via __getattr__ related to python#3968
Methods are passed through at runtime via __getattr__ related to python#3968
This MR breaks out _frozen_importlib_external (which is the same thing as importlib._bootstrap_external) and _frozen_importlib (which is the same thing as importlib._bootstrap). related to python#3968
This MR breaks out _frozen_importlib_external (which is the same thing as importlib._bootstrap_external) and _frozen_importlib (which is the same thing as importlib._bootstrap). related to python#3968
This is getting very close to done now. With the original version of the check run on 3.12 on my macbook, here's what's still left, most of which is unfixable:
These are dynamic at runtime, depending on endianness. No way to accurately represent that in typeshed.
This one is piggy-backing on special casing of builtins.property, and I believe requires additional
This one shows up in the check, but it's just invalid.
On this one,
This one is waiting for PEP 661. We'll see what's possible if/when that becomes available.
At runtime,
These three are fixable, and #12775 fixes them. On 3.9 and lower, there's a few more:
I suspect this could be fixed, but I haven't paid it very much attention since it's both 3.9- only and
These showed up when I ran the check on 3.9 just now, but I don't remember them being there before.
Not fixable; These are artifacts of the fact that classes in
Finally this pair are 3.8 and lower only, which means they're going away soon I believe? I actually haven't run it on 3.13 yet, so let's do that now. 3.13 adds:
And that's everything! I've been working with various stricter versions of the inheritance check |
I had a patch to stubtest that added checking of base classes. Unfortunately, it was too noisy to consider merging, although some fixes did come out of it.
I complicated the patch today, and most of the following look actionable. Figured I'd jot the output down here, so it doesn't get forgotten about, since I'm not sure I want to merge this newly complicated patch (branch at https://github.com/hauntsaninja/mypy/tree/stubtestbaseclass). I'll chip away at these, but if someone reading this is looking to contribute to typeshed, this is a good place to start!
The text was updated successfully, but these errors were encountered: