mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-08 06:44:46 +08:00
Change Decoratee slightly
This commit is contained in:
@@ -4,6 +4,7 @@ docstrings and other things around decorators.
|
|||||||
'''
|
'''
|
||||||
|
|
||||||
from jedi.inference.base_value import ValueWrapper, ValueSet
|
from jedi.inference.base_value import ValueWrapper, ValueSet
|
||||||
|
from jedi.inference.names import ValueName
|
||||||
|
|
||||||
|
|
||||||
class Decoratee(ValueWrapper):
|
class Decoratee(ValueWrapper):
|
||||||
@@ -26,5 +27,10 @@ class Decoratee(ValueWrapper):
|
|||||||
# If a function is returned, the name that we want is usually the
|
# If a function is returned, the name that we want is usually the
|
||||||
# original one. This is obviously a bit weird, but it works pretty
|
# original one. This is obviously a bit weird, but it works pretty
|
||||||
# well, since users don't pass around functions randomly.
|
# well, since users don't pass around functions randomly.
|
||||||
return self._original_value.name
|
val = self._original_value
|
||||||
|
else:
|
||||||
|
val = self._wrapped_value
|
||||||
|
|
||||||
|
if val.name.tree_name is not None:
|
||||||
|
return ValueName(self, val.name.tree_name)
|
||||||
return self._wrapped_value.name
|
return self._wrapped_value.name
|
||||||
|
|||||||
Reference in New Issue
Block a user