stdlib: Add several missing @abstractmethod decorators#7443
stdlib: Add several missing @abstractmethod decorators#7443JelleZijlstra merged 17 commits intopython:masterfrom
@abstractmethod decorators#7443Conversation
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.
| self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None | ||
| ) -> bool | None: ... | ||
|
|
||
| class Event(AbstractContextManager[bool]): |
There was a problem hiding this comment.
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.