From 4a08335fd8a0f30f01b556c8bdc295d22c2f4435 Mon Sep 17 00:00:00 2001 From: Dave Halter Date: Fri, 19 Dec 2014 01:21:00 +0100 Subject: [PATCH] Simplify ExecutedParam. --- jedi/evaluate/param.py | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/jedi/evaluate/param.py b/jedi/evaluate/param.py index a75d06fd..ffa753e4 100644 --- a/jedi/evaluate/param.py +++ b/jedi/evaluate/param.py @@ -143,21 +143,13 @@ class Arguments(pr.Base): class ExecutedParam(pr.Param): + """Fake a param and give it values.""" def __init__(self, values): - """Don't use this method, it's just here to overwrite the old one.""" self.values = values @classmethod def from_param(cls, values, param, parent, var_args): instance = cls(values) - before = () - for cls in param.__class__.__mro__: - with common.ignored(AttributeError): - if before == cls.__slots__: - continue - before = cls.__slots__ - for name in before: - setattr(instance, name, getattr(param, name)) instance.original_param = param instance.parent = parent @@ -172,8 +164,12 @@ class ExecutedParam(pr.Param): @property def position_nr(self): + # Need to use the original logic here, because it uses the parent. return self.original_param.position_nr + def __getattr__(self, name): + return getattr(self.original_param, name) + def _get_calling_var_args(evaluator, var_args): old_var_args = None