typeshed icon indicating copy to clipboard operation
typeshed copied to clipboard

Overload bool.__new__ for Literal bools

Open Gobot1234 opened this issue 2 years ago • 11 comments

Inspired by https://github.com/microsoft/pyright/issues/5515 Closes #6069


Deferred because of: https://github.com/python/mypy/pull/15687

Gobot1234 avatar Jul 15 '23 20:07 Gobot1234

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

github-actions[bot] avatar Jul 15 '23 20:07 github-actions[bot]

Is there a way to see the projects this affects using mypy-primer using my mypy branch?

Gobot1234 avatar Jul 19 '23 10:07 Gobot1234

Is there a way to see the projects this affects using mypy-primer using my mypy branch?

The easiest way would be to temporarily push a commit to your mypy PR that makes these edits to mypy/typeshed/stdlib/builtins.pyi

AlexWaygood avatar Jul 19 '23 10:07 AlexWaygood

Diff from mypy_primer, showing the effect of this PR on open source code:

discord.py (https://github.com/Rapptz/discord.py)
+ discord/app_commands/models.py:205: note:     def __new__(cls) -> int

github-actions[bot] avatar Jul 19 '23 10:07 github-actions[bot]

https://github.com/python/mypy/pull/15687#issuecomment-1641863435 changes don't appear to be causing any problems

Gobot1234 avatar Jul 19 '23 10:07 Gobot1234

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

github-actions[bot] avatar Jul 19 '23 11:07 github-actions[bot]

Diff from mypy_primer, showing the effect of this PR on open source code:

prefect (https://github.com/PrefectHQ/prefect)
+ src/prefect/engine.py:2851: error: Unexpected keyword argument "task" for "create_call"  [call-arg]
+ src/prefect/_internal/concurrency/api.py:41: note: "create_call" defined here
+ src/prefect/engine.py:2851: error: Unexpected keyword argument "task_run" for "create_call"  [call-arg]
+ src/prefect/_internal/concurrency/api.py:41: note: "create_call" defined here
+ src/prefect/engine.py:2851: error: Unexpected keyword argument "state" for "create_call"  [call-arg]
+ src/prefect/_internal/concurrency/api.py:41: note: "create_call" defined here

github-actions[bot] avatar Feb 17 '24 16:02 github-actions[bot]

Still waiting for python/mypy#15687.

srittau avatar Feb 19 '24 05:02 srittau