8000 Skip overlapping overload checks in ignored files (#10922) · python/mypy@805bbde · GitHub
[go: up one dir, main page]

Skip to content

Commit 805bbde

Browse files
authored
Skip overlapping overload checks in ignored files (#10922)
Resolves #9691 As mentioned in that issue, this is a huge performance win. On the codebase I'm currently working on, it halves a cacheless interpreted mypy runtime. The linked issue contains some more measurement. Co-authored-by: hauntsaninja <>
1 parent 989d600 commit 805bbde

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

mypy/checker.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -466,6 +466,13 @@ def check_overlapping_overloads(self, defn: OverloadedFuncDef) -> None:
466466
# At this point we should have set the impl already, and all remaining
467467
# items are decorators
468468

469+
if self.msg.errors.file in self.msg.errors.ignored_files:
470+
# This is a little hacky, however, the quadratic check here is really expensive, this
471+
# method has no side effects, so we should skip it if we aren't going to report
472+
# anything. In some other places we swallow errors in stubs, but this error is very
473+
# useful for stubs!
474+
return
475+
469476
# Compute some info about the implementation (if it exists) for use below
470477
impl_type: Optional[CallableType] = None
471478
if defn.impl:

0 commit comments

Comments
 (0)
0