Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions docs/source/error_code_list.rst
Original file line number Diff line number Diff line change
Expand Up @@ -764,6 +764,19 @@ the provided type.

assert_type([1], list[str]) # Error

Check that function isn't used in boolean context [truthy-function]
-------------------------------------------------------------------

Functions will always evaluate to true in boolean contexts.

.. code-block:: python

def f():
...

if f: # Error: Function "Callable[[], Any]" could always be true in boolean context [truthy-function]
pass

Report syntax errors [syntax]
-----------------------------

Expand Down
13 changes: 0 additions & 13 deletions docs/source/error_code_list2.rst
Original file line number Diff line number Diff line change
Expand Up @@ -256,19 +256,6 @@ what the author might have intended. Of course it's possible that ``transform``
and so there is no error in practice. In such case, it is recommended to annotate ``items: Collection[int]``.


Check that function isn't used in boolean context [truthy-function]
-------------------------------------------------------------------

Functions will always evaluate to true in boolean contexts.

.. code-block:: python

def f():
...

if f: # Error: Function "Callable[[], Any]" could always be true in boolean context [truthy-function]
pass

.. _ignore-without-code:

Check that ``# type: ignore`` include an error code [ignore-without-code]
Expand Down