Repository navigation
Commit 38337a8
authored
Rework how we refine information from callable() (#4343)
Don't assume that something is *not* callable except when operating
on Union types.
Normally, when operating on an Instance that is not clearly callable,
construct a callable version of it by generating a fake subclass with a
__call__ method. When operating on Union types, continue treating
types that are not clearly callable as if they cannot be callable,
so type discrimination using callable() behaves as expected.
Fixes #36051 parent f7f35e4 commit 38337a8
6 files changed
Lines changed: 457 additions & 241 deletions
File tree
- mypy
- test-data/unit
0 commit comments