-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
stdlib: Add several missing @abstractmethod
decorators
#7443
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
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
1 similar comment
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
||
class Event(AbstractContextManager[bool]): |
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.
This class doesn't seem to be a context manager at runtime, and doesn't seem to have ever been a context manager at runtime.
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
This comment has been minimized.
This comment has been minimized.
5 similar comments
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
1 similar comment
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
These are weird -- looks like this crossed the streams with #7423 being merged, maybe? |
The boostedblob errors are unfortunate. They're in places like https://github.com/hauntsaninja/boostedblob/blob/eb6e95b41ba55c4c595cbe754d05a48f069ce42e/boostedblob/path.py#L328, where And yeah, not sure what caused the ChainMap changes. |
Oh wait, I bet mypy special cases |
And now pyright in CI is complaining about shutil, which you didn't change. |
Yeah, it's because #7384 made |
This comment has been minimized.
This comment has been minimized.
See #7384 and #7443 (comment) (thanks @AlexWaygood for diagnosing).
See #7384 and #7443 (comment) (thanks @AlexWaygood for diagnosing).
Ah good catch |
According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉 |
The following methods are all abstract at runtime, but not in the stub:
typing.ContextManager.__exit__
(and therefore alsocontextlib.AbstractContextManager.__exit__
)typing.AsyncContextManager.__aexit__
(and therefore alsocontextlib.AbstractAsyncContextManager.__aexit__
)numbers.Complex.__eq__
numbers.Complex.__abs__
numbers.Complex.__conjugate__
os.PathLike.__fspath__
This means that inheriting from any of these classes at runtime without overriding these methods would cause an exception to be raised. Type checkers, however, would not have flagged the possibility of an exception being raised, believing these methods to be concrete.