sbdchd / django-types

:doughnut: Type stubs for Django
MIT License
187 stars 62 forks source link

Use Self type from PEP 673 everywhere #183

Closed hamdanal closed 1 year ago

hamdanal commented 1 year ago

This PR makes consistent use of the Self type. It also removes version checks for from typing_extensions Self and others as typing_extentions is considered a builtin module in stubs by all major type checkers (see typeshed). I added an isort option to reflect that fact similar to what is done in the typeshed project.

hamdanal commented 1 year ago

Thank you @sbdchd . Would you be open to a PR updating this project to use PEP-585 (list instead of typing.List and the like) and another to use PEP-604 (A | B instead of typing.Union[A, B]? I think the new syntax is more readable and easier to maintain. I can also add a linter that keeps these up-to-date with auto-formatting. All of this is already done over at the typeshed project.

sbdchd commented 1 year ago

yeah that make sense!