-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Fix typing for uuid4() #2164
Fix typing for uuid4() #2164
Conversation
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.
Thank you!
We must also update the generate_stubs.py
script to support the @overload
decorator.
@fcurella done. Also updated the dependency management to make it easier to consistently develop |
@@ -8,13 +8,16 @@ mypy: | |||
mypy --install-types --non-interactive --config mypy.ini faker | |||
|
|||
black: | |||
black --line-length 120 . |
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.
This is now defined in pyproject.toml
and needn't be tracked elsewhere.
black faker/proxy.pyi | ||
isort faker/proxy.pyi |
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.
Unless these are applied you don't actually see your changes properly.
Done in 9c8b132 |
What does this change
uuid4()
, so that static type checkers understand the return type based on the inputsWhat was wrong
uuid4()
, because these tools rightly point out that the return type is one ofUUID | str | bytes
How this fixes it
Checklist
make lint