Some final touches for variadic types support#16334
Merged
ilevkivskyi merged 14 commits intopython:masterfrom Oct 28, 2023
Merged
Some final touches for variadic types support#16334ilevkivskyi merged 14 commits intopython:masterfrom
ilevkivskyi merged 14 commits intopython:masterfrom
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Contributor
|
Diff from mypy_primer, showing the effect of this PR on open source code: openlibrary (https://github.com/internetarchive/openlibrary)
+ openlibrary/plugins/openlibrary/lists.py:272: error: Unused "type: ignore" comment [unused-ignore]
+ openlibrary/plugins/openlibrary/lists.py:317: error: Unused "type: ignore" comment [unused-ignore]
prefect (https://github.com/PrefectHQ/prefect)
- src/prefect/events/worker.py:48: error: Signature of "instance" incompatible with supertype "QueueService" [override]
- src/prefect/events/worker.py:48: note: Superclass:
- src/prefect/events/worker.py:48: note: @classmethod
- src/prefect/events/worker.py:48: note: def instance(cls, *args: Any) -> EventsWorker
- src/prefect/events/worker.py:48: note: Subclass:
- src/prefect/events/worker.py:48: note: @classmethod
- src/prefect/events/worker.py:48: note: def instance(cls, client_type: type[EventsClient] | None = ...) -> EventsWorker
- src/prefect/logging/handlers.py:70: error: Signature of "instance" incompatible with supertype "QueueService" [override]
- src/prefect/logging/handlers.py:70: note: Superclass:
- src/prefect/logging/handlers.py:70: note: @classmethod
- src/prefect/logging/handlers.py:70: note: def instance(cls, *args: Any) -> APILogWorker
- src/prefect/logging/handlers.py:70: note: Subclass:
- src/prefect/logging/handlers.py:70: note: @classmethod
- src/prefect/logging/handlers.py:70: note: def instance(cls) -> APILogWorker
mongo-python-driver (https://github.com/mongodb/mongo-python-driver)
+ bson/son.py:71: error: Unused "type: ignore" comment [unused-ignore]
|
hauntsaninja
approved these changes
Oct 28, 2023
Collaborator
hauntsaninja
left a comment
There was a problem hiding this comment.
Ah, just saw I didn't do merge right, thanks for fixing! Tests and changes I understand look good
Member
Author
JukkaL
approved these changes
Oct 28, 2023
Collaborator
JukkaL
left a comment
There was a problem hiding this comment.
Did a quick review pass, looks good.
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
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.
I decided to go again over various parts of variadic types implementation to double-check nothing is missing, checked interaction with various "advanced" features (dataclasses, protocols, self-types, match statement, etc.), added some more tests (including incremental), and
greped for potentially unhandled cases (and did found few crashes). This mostly touches only variadic types but one thing goes beyond, the fix for self-types upper bound, I think it is correct and should be safe.If there are no objections, next PR will flip the switch.