Skip to content

Conversation

sobolevn
Copy link
Member

This is debatable, because __bool__ can be defined as return True or return False.
And we don't check this in scope of this PR.

But, it solves the given problem.

Closes #11819

@github-actions

This comment has been minimized.

1 similar comment
@github-actions
Copy link
Contributor

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

steam.py (https://github.com/Gobot1234/steam.py)
- steam/utils.py:141: error: Incompatible types in assignment (expression has type "int", variable has type "Optional[Union[Literal[0], Literal[1], Literal[2], Literal[4]]]")  [assignment]

@JelleZijlstra JelleZijlstra merged commit c0c86d0 into python:master Jan 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Overriding __bool__ in NamedTuple doesn't work
3 participants