Skip to content

Some final touches for variadic types support#16334

Merged
ilevkivskyi merged 14 commits into
python:masterfrom
ilevkivskyi:more-tvt
Oct 28, 2023
Merged

Some final touches for variadic types support#16334
ilevkivskyi merged 14 commits into
python:masterfrom
ilevkivskyi:more-tvt

Conversation

@ilevkivskyi

Copy link
Copy Markdown
Member

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.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

Copy link
Copy Markdown
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 hauntsaninja left a comment

Copy link
Copy Markdown
Collaborator

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

@ilevkivskyi

Copy link
Copy Markdown
Member Author

@jhance @JukkaL To speed things up I am going to merge this later today, if there are no more comments.

@JukkaL JukkaL left a comment

Copy link
Copy Markdown
Collaborator

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.

@ilevkivskyi
ilevkivskyi merged commit f33c9a3 into python:master Oct 28, 2023
@ilevkivskyi
ilevkivskyi deleted the more-tvt branch October 28, 2023 13:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants