equal
deleted
inserted
replaced
11 |
11 |
12 import ast |
12 import ast |
13 import codecs |
13 import codecs |
14 import re as remod |
14 import re as remod |
15 import textwrap |
15 import textwrap |
|
16 import types |
16 |
17 |
17 from ..i18n import _ |
18 from ..i18n import _ |
18 from ..thirdparty import attr |
19 from ..thirdparty import attr |
19 |
20 |
20 from .. import ( |
21 from .. import ( |
62 elif isinstance(o, set): |
63 elif isinstance(o, set): |
63 return 'set([%s])' % (b', '.join( |
64 return 'set([%s])' % (b', '.join( |
64 pprint(k, bprefix=bprefix) for k in sorted(o))) |
65 pprint(k, bprefix=bprefix) for k in sorted(o))) |
65 elif isinstance(o, tuple): |
66 elif isinstance(o, tuple): |
66 return '(%s)' % (b', '.join(pprint(a, bprefix=bprefix) for a in o)) |
67 return '(%s)' % (b', '.join(pprint(a, bprefix=bprefix) for a in o)) |
|
68 elif isinstance(o, types.GeneratorType): |
|
69 return 'gen[%s]' % (b', '.join(pprint(a, bprefix=bprefix) for a in o)) |
67 else: |
70 else: |
68 return pycompat.byterepr(o) |
71 return pycompat.byterepr(o) |
69 |
72 |
70 def prettyrepr(o): |
73 def prettyrepr(o): |
71 """Pretty print a representation of a possibly-nested object""" |
74 """Pretty print a representation of a possibly-nested object""" |