Skip to content
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

Use annotations from the standard library #60859

Closed
wants to merge 1 commit into from

Conversation

tqa236
Copy link
Contributor

@tqa236 tqa236 commented Feb 5, 2025

This is the preferred way to annotate starting from Python 3.9. All changes are auto-fixed by ruff

  • closes #xxxx (Replace xxxx with the GitHub issue number)
  • Tests added and passed if fixing a bug or adding a new feature
  • All code checks passed.
  • Added type annotations to new arguments/methods/functions.
  • Added an entry in the latest doc/source/whatsnew/vX.X.X.rst file if fixing a bug or adding a new feature.

@tqa236
Copy link
Contributor Author

tqa236 commented Feb 5, 2025

apparently, there are some difference between typing.Type and type when Type[T] works as a Generic, so I'll close the PR

@tqa236 tqa236 closed this Feb 5, 2025
@tqa236 tqa236 deleted the pep585-annotation branch February 5, 2025 20:33
@Dr-Irv
Copy link
Contributor

Dr-Irv commented Feb 5, 2025

apparently, there are some difference between typing.Type and type when Type[T] works as a Generic, so I'll close the PR

I don't think that was your issue. typing.Type is deprecated, so Type[T] can be replaced with type[T]. Looking at the logs of the tests, you failed to get rid of all references to type_t throughout the source, and if you do that, you may be able to resurrect this.

@tqa236
Copy link
Contributor Author

tqa236 commented Feb 5, 2025

thanks for the comment, @Dr-Irv. I changed and tested it locally and it leads to a lot of other errors. Fixing them all would be tough so I'll try to see if there's a way to fix a subset of that first.

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.

2 participants