diff --git a/docs/source/common_issues.rst b/docs/source/common_issues.rst index e4239bd7a8ee..d1a13efa4f7f 100644 --- a/docs/source/common_issues.rst +++ b/docs/source/common_issues.rst @@ -33,6 +33,9 @@ Example: def foo(a): return '(' + a.split() + ')' # No error! + This often surprises beginners, because mypy only checks functions that have type annotations by default. + + This gives no error even though ``a.split()`` is "obviously" a list (the author probably meant ``a.strip()``). The error is reported once you add annotations: