-
Notifications
You must be signed in to change notification settings - Fork 360
Use stdlib override when possible #1532
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
Merged
vidartf
merged 7 commits into
jupyter-server:main
from
edrogers:use-stdlib-override-when-possible
Aug 6, 2025
Merged
Use stdlib override when possible #1532
vidartf
merged 7 commits into
jupyter-server:main
from
edrogers:use-stdlib-override-when-possible
Aug 6, 2025
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for more information, see https://pre-commit.ci
bollwyvl
approved these changes
Jul 24, 2025
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, LGTM!
krassowski
approved these changes
Aug 5, 2025
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.
Would be great to have that in to allow testing with Python 3.14
vidartf
approved these changes
Aug 6, 2025
Ponce
pushed a commit
to Ponce/slackbuilds
that referenced
this pull request
Aug 25, 2025
It's not needed anymnore for python >= 3.12 jupyter-server/jupyter_server#1532 Signed-off-by: Matteo Bernardini <[email protected]>
Ponce
pushed a commit
to Ponce/slackbuilds
that referenced
this pull request
Aug 31, 2025
It's not needed anymnore for python >= 3.12 jupyter-server/jupyter_server#1532 Signed-off-by: Matteo Bernardini <[email protected]>
Ponce
pushed a commit
to Ponce/slackbuilds
that referenced
this pull request
Sep 6, 2025
It's not needed anymnore for python >= 3.12 jupyter-server/jupyter_server#1532 Signed-off-by: Matteo Bernardini <[email protected]>
Ponce
pushed a commit
to Ponce/slackbuilds
that referenced
this pull request
Sep 13, 2025
It's not needed anymnore for python >= 3.12 jupyter-server/jupyter_server#1532 Signed-off-by: Matteo Bernardini <[email protected]>
Ponce
pushed a commit
to Ponce/slackbuilds
that referenced
this pull request
Sep 20, 2025
It's not needed anymnore for python >= 3.12 jupyter-server/jupyter_server#1532 Signed-off-by: Matteo Bernardini <[email protected]>
Ponce
pushed a commit
to Ponce/slackbuilds
that referenced
this pull request
Sep 27, 2025
It's not needed anymnore for python >= 3.12 jupyter-server/jupyter_server#1532 Signed-off-by: Matteo Bernardini <[email protected]>
Ponce
pushed a commit
to Ponce/slackbuilds
that referenced
this pull request
Oct 4, 2025
It's not needed anymnore for python >= 3.12 jupyter-server/jupyter_server#1532 Signed-off-by: Matteo Bernardini <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #1531
This PR uses
typing.override
in favor of theoverrides
dependency when possible. As of Python 3.12, the standard library offerstyping.override
to perform a static check on overridden methods.Motivation
Currently,
overrides
is incompatible with Python 3.14. As a result, any package that attempts to importoverrides
using Python 3.14+ will raise anAttributeError
. An issue has been raised and a pull request has been submitted to the GitHub repo for theoverrides
project. But the maintainer has been unresponsive.To ensure readiness for Python 3.14, this package (and any other package directly depending on
overrides
) should consider usingtyping.override
instead.Impact
The standard library added
typing.override
as of 3.12. As a result, this change will affect only users of Python 3.12+. Previous versions will continue to rely onoverrides
. Notably, the standard library implementation is slightly different than that ofoverrides
. A thorough discussion of those differences is shown in PEP 698, and it is also summarized nicely by the maintainer ofoverrides
here. The upshot is thattyping.override
does not implement any runtime checking. Instead, it provides information to type checkers.An Alternative Approach
We could imagine preferring the
overrides
package when it's available and imports successfully. That implementation might look like this:While I originally considered this approach, a dive into why
overrides
was brought in as a dependency turned up this conversation between @Zsailer and @kevin-bates. In it, @Zsailer refers to theoverrides
library as a "temporary" dependency. The PR as I've written it here makes a silent switch over to using the standard library approach going forward.