Overload bool.__new__ for Literal bools
Inspired by https://github.com/microsoft/pyright/issues/5515 Closes #6069
Deferred because of: https://github.com/python/mypy/pull/15687
According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉
Is there a way to see the projects this affects using mypy-primer using my mypy branch?
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
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
https://github.com/python/mypy/pull/15687#issuecomment-1641863435 changes don't appear to be causing any problems
According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉
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
Still waiting for python/mypy#15687.