Skip to content

Replace aliases by builtins.* in uuid #10422

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

Merged
merged 1 commit into from
Jul 8, 2023
Merged

Conversation

hamdanal
Copy link
Contributor

@hamdanal hamdanal commented Jul 8, 2023

These aliases were used because the class has properties called int and bytes. I think it is better to use the shadowed types from the builtins module. This should not change anything from the type checking side but it improves the IDE experience1.

Footnotes

  1. I was using uuid recently and the aliases showed up in vscode, I thought they were uuid special types and had to look in the stub to know what they are.

These aliases were used because the class has properties called
`int` and `bytes`. I think it is better to use the shadowed types
from the builtins module. This should not change anything from the
type checking side but it improves the IDE experience[^1].

[^1]: I was using uuid recently and the aliases showed up in vscode,
I thought they were uuid special types and had to look in the stub to
know what they are.
@github-actions
Copy link
Contributor

github-actions bot commented Jul 8, 2023

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

@AlexWaygood AlexWaygood merged commit aed8c3f into python:main Jul 8, 2023
@hamdanal hamdanal deleted the uuid branch July 8, 2023 13:23
@hamdanal
Copy link
Contributor Author

hamdanal commented Jul 8, 2023

Thanks Alex

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