Skip to content

Commit 309b01e

Browse files
authored
Make untyped_calls_exclude invalidate cache (#19801)
Fixes #16652 This is minor and straightforward, so I am going to just merge it (assuming everything passes).
1 parent 8f2371a commit 309b01e

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

mypy/options.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ class BuildType:
7474
"disable_memoryview_promotion",
7575
"strict_bytes",
7676
"fixed_format_cache",
77+
"untyped_calls_exclude",
7778
}
7879
) - {"debug_cache"}
7980

test-data/unit/check-incremental.test

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6865,6 +6865,24 @@ if int():
68656865
[out2]
68666866
main:6: error: Incompatible types in assignment (expression has type "str", variable has type "int")
68676867

6868+
[case testUntypedCallsExcludeAffectsCache]
6869+
# flags: --disallow-untyped-calls --untyped-calls-exclude=mod.Super
6870+
# flags2: --disallow-untyped-calls --untyped-calls-exclude=mod
6871+
# flags3: --disallow-untyped-calls --untyped-calls-exclude=mod.Super
6872+
import mod
6873+
[file mod.py]
6874+
class Super:
6875+
def draw(self):
6876+
...
6877+
class Class(Super):
6878+
...
6879+
Class().draw()
6880+
[out]
6881+
tmp/mod.py:6: error: Call to untyped function "draw" in typed context
6882+
[out2]
6883+
[out3]
6884+
tmp/mod.py:6: error: Call to untyped function "draw" in typed context
6885+
68686886
[case testMethodMakeBoundIncremental]
68696887
from a import A
68706888
a = A()

0 commit comments

Comments
 (0)