mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-06 22:14:27 +08:00
Make sure the repr of compiled access isn't huge
This commit is contained in:
@@ -103,6 +103,15 @@ SignatureParam = namedtuple(
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def shorten_repr(func):
|
||||||
|
def wrapper(self):
|
||||||
|
r = func(self)
|
||||||
|
if len(r) > 50:
|
||||||
|
r = r[:50] + '..'
|
||||||
|
return r
|
||||||
|
return wrapper
|
||||||
|
|
||||||
|
|
||||||
def compiled_objects_cache(attribute_name):
|
def compiled_objects_cache(attribute_name):
|
||||||
def decorator(func):
|
def decorator(func):
|
||||||
"""
|
"""
|
||||||
@@ -283,6 +292,7 @@ class DirectObjectAccess(object):
|
|||||||
return paths
|
return paths
|
||||||
|
|
||||||
@_force_unicode_decorator
|
@_force_unicode_decorator
|
||||||
|
@shorten_repr
|
||||||
def get_repr(self):
|
def get_repr(self):
|
||||||
builtins = 'builtins', '__builtin__'
|
builtins = 'builtins', '__builtin__'
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user