Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit febe9ec

Browse files
committed
Treat dicts as ordered from Python 3.6
1 parent 324eddd commit febe9ec

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

IPython/lib/pretty.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,9 @@ def _repr_pretty_(self, p, cycle):
9595

9696

9797
MAX_SEQ_LENGTH = 1000
98-
DICT_IS_ORDERED = sys.version_info >= (3, 7)
98+
# The language spec says that dicts preserve order from 3.7, but CPython
99+
# does so from 3.6, so it seems likely that people will expect that.
100+
DICT_IS_ORDERED = sys.version_info >= (3, 6)
99101
_re_pattern_type = type(re.compile(''))
100102

101103
def _safe_getattr(obj, attr, default=None):

0 commit comments

Comments
 (0)