-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Some final touches for variadic types support #16334
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
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]
|
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.
Ah, just saw I didn't do merge right, thanks for fixing! Tests and changes I understand look good
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.
Did a quick review pass, looks good.
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
grep
ed 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.