summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhippo91 <guillaume.peillex@gmail.com>2021-02-06 19:23:01 +0100
committerPierre Sassoulas <pierre.sassoulas@gmail.com>2021-02-10 19:30:13 +0100
commit2c2480691cf90052a7624ca79d0d680280ca2900 (patch)
tree98bdd6aafc8761a47b2a7c882fdccfd05e569549
parentf50eff2fb9a11d7d4360c27e317ac8fcfa95c145 (diff)
downloadastroid-git-2c2480691cf90052a7624ca79d0d680280ca2900.tar.gz
Unify the way property arguments are declared
-rw-r--r--astroid/interpreter/objectmodel.py14
1 files changed, 13 insertions, 1 deletions
diff --git a/astroid/interpreter/objectmodel.py b/astroid/interpreter/objectmodel.py
index eb2de21b..11c5e463 100644
--- a/astroid/interpreter/objectmodel.py
+++ b/astroid/interpreter/objectmodel.py
@@ -775,6 +775,7 @@ class PropertyModel(ObjectModel):
@property
def attr_fget(self):
from astroid.scoped_nodes import FunctionDef
+ from astroid.node_classes import Arguments, AssignName
func = self._instance
@@ -790,8 +791,19 @@ class PropertyModel(ObjectModel):
caller=caller, context=context
)
+ l_args = Arguments()
+ l_args.postinit(
+ args=[AssignName(name="self")],
+ defaults=[],
+ kwonlyargs=[],
+ kw_defaults=[],
+ annotations=[],
+ posonlyargs=[],
+ posonlyargs_annotations=[],
+ kwonlyargs_annotations=[],
+ )
property_accessor = PropertyFuncAccessor(name="fget", parent=self._instance)
- property_accessor.postinit(args=func.args, body=func.body)
+ property_accessor.postinit(args=l_args, body=func.body)
return property_accessor
@property