@@ -4400,9 +4400,9 @@ def set_inferred_type(self, var: Var, lvalue: Lvalue, type: Type) -> None:
44004400 refers to the variable (lvalue). If var is None, do nothing.
44014401 """
44024402 if var and not self .current_node_deferred :
4403- # TODO: should we also set 'is_ready = True' here?
44044403 var .type = type
44054404 var .is_inferred = True
4405+ var .is_ready = True
44064406 if var not in self .var_decl_frames :
44074407 # Used for the hack to improve optional type inference in conditionals
44084408 self .var_decl_frames [var ] = {frame .id for frame in self .binder .frames }
@@ -4424,6 +4424,11 @@ def set_inferred_type(self, var: Var, lvalue: Lvalue, type: Type) -> None:
44244424 var .is_staticmethod = True
44254425 elif is_node_class (definition ):
44264426 var .is_classmethod = True
4427+ elif is_property (definition ):
4428+ var .is_property = True
4429+ if isinstance (p_type , Overloaded ):
4430+ # TODO: in theory we can have a property with a deleter only.
4431+ var .is_settable_property = True
44274432
44284433 def set_inference_error_fallback_type (self , var : Var , lvalue : Lvalue , type : Type ) -> None :
44294434 """Store best known type for variable if type inference failed.
@@ -8801,6 +8806,8 @@ def is_static(func: FuncBase | Decorator) -> bool:
88018806
88028807
88038808def is_property (defn : SymbolNode ) -> bool :
8809+ if isinstance (defn , FuncDef ):
8810+ return defn .is_property
88048811 if isinstance (defn , Decorator ):
88058812 return defn .func .is_property
88068813 if isinstance (defn , OverloadedFuncDef ):
0 commit comments