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

Generator return type and send type are treated as None under allow-any-generics #17286

Closed
koogoro opened this issue May 24, 2024 · 3 comments
Closed
Labels
bug mypy got something wrong

Comments

@koogoro
Copy link
Collaborator

koogoro commented May 24, 2024

Bug Report
On the newest master, Generator is not the same as Generator[Any, Any, Any] with allow-any-generics enabled. This doesn't happen on 1.10.0.

To Reproduce
https://gist.github.com/mypy-play/16ab6e35d0fa38ee42cd9d40b3a7474d

Expected Behavior
No errors.

Actual Behavior

main.py:5: error: Incompatible types in assignment (expression has type "None", variable has type "str")  [assignment]
main.py:6: error: No return value expected  [return-value]
@koogoro koogoro added the bug mypy got something wrong label May 24, 2024
@hauntsaninja
Copy link
Collaborator

hauntsaninja commented May 24, 2024

Looks like it bisects to #17246 . Generator now uses PEP 696, so Generator and Generator[Any, Any, Any] should be different

@JelleZijlstra
Copy link
Member

This seems like an expected consequence of PEP 696; the two type parameters now default to None.

@koogoro
Copy link
Collaborator Author

koogoro commented May 24, 2024

Oh nice. Seems like it's not a bug after all!

@koogoro koogoro closed this as not planned Won't fix, can't repro, duplicate, stale May 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug mypy got something wrong
Projects
None yet
Development

No branches or pull requests

3 participants