mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-07 22:44:27 +08:00
function repr should only include the decorated function if it actually is one.
This commit is contained in:
@@ -412,10 +412,10 @@ class Function(use_metaclass(CachedMetaClass, pr.IsScope)):
|
||||
return getattr(self.base_func, name)
|
||||
|
||||
def __repr__(self):
|
||||
decorated_func = self._decorated_func()
|
||||
dec_func = self._decorated_func()
|
||||
dec = ''
|
||||
if decorated_func is not None and decorated_func != self:
|
||||
dec = " is " + repr(decorated_func)
|
||||
if not self.is_decorated and self.base_func.decorators:
|
||||
dec = " is " + repr(dec_func)
|
||||
return "<e%s of %s%s>" % (type(self).__name__, self.base_func, dec)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user