File tree 2 files changed +7
-4
lines changed 2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -648,8 +648,10 @@ def infer_property(
648
648
name = "<property>" ,
649
649
lineno = node .lineno ,
650
650
col_offset = node .col_offset ,
651
- # ↓ semantically, the definition of this property isn't within
652
- # node.frame (or anywhere else, really)
651
+ # ↓ semantically, the definition of the class of property isn't within
652
+ # node.frame. It's somewhere in the builtins module, but we are special
653
+ # casing it for each "property()" call, so we are making up the
654
+ # definition on the spot, ad-hoc.
653
655
parent = AstroidManager ().adhoc_module ,
654
656
)
655
657
prop_func .postinit (
Original file line number Diff line number Diff line change @@ -28,8 +28,9 @@ def getter():
28
28
self .assertIsInstance (class_parent , nodes .ClassDef )
29
29
self .assertFalse (
30
30
any (
31
- isinstance (getter , objects .Property )
32
- for getter in class_parent .locals ["getter" ]
31
+ isinstance (def_ , objects .Property )
32
+ for def_list in class_parent .locals .values ()
33
+ for def_ in def_list
33
34
)
34
35
)
35
36
self .assertTrue (hasattr (inferred_property , "args" ))
You can’t perform that action at this time.
0 commit comments