Add MAX_VARIABLE_LENGTH constant

This commit is contained in:
Ram Rachum 2019-04-23 11:11:38 +03:00
parent 3279c00b9e
commit 4419548374
2 changed files with 5 additions and 3 deletions

View file

@ -9,10 +9,12 @@ import datetime as datetime_module
import six
MAX_VARIABLE_LENGTH = 100
def get_shortish_repr(item):
r = repr(item)
if len(r) > 100:
r = '{truncated_r}...'.format(truncated_r=r[:97])
if len(r) > MAX_VARIABLE_LENGTH:
r = '{truncated_r}...'.format(truncated_r=r[:MAX_VARIABLE_LENGTH])
return r
def get_local_reprs(frame, variables=()):

View file

@ -5,7 +5,7 @@ import setuptools
setuptools.setup(
name='PySnooper',
version='0.0.8',
version='0.0.9',
author='Ram Rachum',
author_email='ram@rachum.com',
description="A poor man's debugger for Python.",