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

False positive RUF013 PEP 484 prohibits implicit Optional #9334

Closed
randolf-scholz opened this issue Dec 31, 2023 · 1 comment · Fixed by #9335
Closed

False positive RUF013 PEP 484 prohibits implicit Optional #9334

randolf-scholz opened this issue Dec 31, 2023 · 1 comment · Fixed by #9335
Assignees
Labels
bug Something isn't working

Comments

@randolf-scholz
Copy link

The bug occurs if Optional is imported from typing_extensions instead of typing.

from typing_extensions import Optional

def foo(x: Optional[int] = None):
     pass

https://play.ruff.rs/dda2f645-171a-4666-93c6-d686c3f7edfa

@charliermarsh
Copy link
Member

Fixed in #9335, thanks.

charliermarsh added a commit that referenced this issue Dec 31, 2023
## Summary

Historically, we encoded this list by extracting the `__all__`. I went
to update it, but... is there really any value in it? Seems easier to
just treat `typing_extensions` as an alias for `typing`.

Closes #9334.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants