[red-knot] Diagnostics for incorrect bool usages (#16238)

This commit is contained in:
Micha Reiser
2025-02-21 18:26:05 +00:00
committed by GitHub
parent 3aa7ba31b1
commit 5fab97f1ef
28 changed files with 1267 additions and 260 deletions

View File

@@ -0,0 +1,14 @@
# Calling builtins
## `bool` with incorrect arguments
```py
class NotBool:
__bool__ = None
# TODO: We should emit an `invalid-argument` error here for `2` because `bool` only takes one argument.
bool(1, 2)
# TODO: We should emit an `unsupported-bool-conversion` error here because the argument doesn't implement `__bool__` correctly.
bool(NotBool())
```