-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Closed
Labels
bugSomething isn't workingSomething isn't workingtyMulti-file analysis & type inferenceMulti-file analysis & type inference
Description
Summary
We currently distinguish between Type::member (with descriptor protocol) and Type::static_member (without descriptor protocol). The former corresponds to obj.attr, the latter corresponds to getattr_static(obj, "attr"). However, to model some details in the descriptor protocl correctly, we would also need to distinguish between a static member lookup with and without instance variables. The lookup without instance variables corresponds to find_name_in_mro here. We currently approximate both using member_static.
One example where this leads to incorrect behavior is the following example:
def some_function(x: int) -> str:
return "a"
class C:
def __init__(self):
self.function = some_function
c = C()
c.function(1) # We currently emit errors here because `function` is treated as a bound methodReactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingtyMulti-file analysis & type inferenceMulti-file analysis & type inference