Show More
@@ -97,9 +97,6 b" __all__ = ['pretty', 'pprint', 'PrettyPrinter', 'RepresentationPrinter'," | |||||
97 |
|
97 | |||
98 |
|
98 | |||
99 | MAX_SEQ_LENGTH = 1000 |
|
99 | MAX_SEQ_LENGTH = 1000 | |
100 | # The language spec says that dicts preserve order from 3.7, but CPython |
|
|||
101 | # does so from 3.6, so it seems likely that people will expect that. |
|
|||
102 | DICT_IS_ORDERED = True |
|
|||
103 | _re_pattern_type = type(re.compile('')) |
|
100 | _re_pattern_type = type(re.compile('')) | |
104 |
|
101 | |||
105 | def _safe_getattr(obj, attr, default=None): |
|
102 | def _safe_getattr(obj, attr, default=None): | |
@@ -606,11 +603,6 b' def _dict_pprinter_factory(start, end):' | |||||
606 | step = len(start) |
|
603 | step = len(start) | |
607 | p.begin_group(step, start) |
|
604 | p.begin_group(step, start) | |
608 | keys = obj.keys() |
|
605 | keys = obj.keys() | |
609 | # if dict isn't large enough to be truncated, sort keys before displaying |
|
|||
610 | # From Python 3.7, dicts preserve order by definition, so we don't sort. |
|
|||
611 | if not DICT_IS_ORDERED \ |
|
|||
612 | and not (p.max_seq_length and len(obj) >= p.max_seq_length): |
|
|||
613 | keys = _sorted_for_pprint(keys) |
|
|||
614 | for idx, key in p._enumerate(keys): |
|
606 | for idx, key in p._enumerate(keys): | |
615 | if idx: |
|
607 | if idx: | |
616 | p.text(',') |
|
608 | p.text(',') |
General Comments 0
You need to be logged in to leave comments.
Login now