aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/python/ipython/py2/IPython/lib/pretty.py
diff options
context:
space:
mode:
authorNikita Slyusarev <nslus@yandex-team.com>2022-02-10 16:46:52 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:46:52 +0300
commitcd77cecfc03a3eaf87816af28a33067c4f0cdb59 (patch)
tree1308e0bae862d52e0020d881fe758080437fe389 /contrib/python/ipython/py2/IPython/lib/pretty.py
parentcdae02d225fb5b3afbb28990e79a7ac6c9125327 (diff)
downloadydb-cd77cecfc03a3eaf87816af28a33067c4f0cdb59.tar.gz
Restoring authorship annotation for Nikita Slyusarev <nslus@yandex-team.com>. Commit 1 of 2.
Diffstat (limited to 'contrib/python/ipython/py2/IPython/lib/pretty.py')
-rw-r--r--contrib/python/ipython/py2/IPython/lib/pretty.py38
1 files changed, 19 insertions, 19 deletions
diff --git a/contrib/python/ipython/py2/IPython/lib/pretty.py b/contrib/python/ipython/py2/IPython/lib/pretty.py
index 28eee523c5a..09d638cbcb8 100644
--- a/contrib/python/ipython/py2/IPython/lib/pretty.py
+++ b/contrib/python/ipython/py2/IPython/lib/pretty.py
@@ -85,7 +85,7 @@ import re
import datetime
from collections import deque
-from IPython.utils.py3compat import PY3, PYPY, cast_unicode, string_types
+from IPython.utils.py3compat import PY3, PYPY, cast_unicode, string_types
from IPython.utils.encoding import get_stream_enc
from io import StringIO
@@ -609,8 +609,8 @@ def _dict_pprinter_factory(start, end):
def inner(obj, p, cycle):
if cycle:
return p.text('{...}')
- step = len(start)
- p.begin_group(step, start)
+ step = len(start)
+ p.begin_group(step, start)
keys = obj.keys()
# if dict isn't large enough to be truncated, sort keys before displaying
# From Python 3.7, dicts preserve order by definition, so we don't sort.
@@ -624,7 +624,7 @@ def _dict_pprinter_factory(start, end):
p.pretty(key)
p.text(': ')
p.pretty(obj[key])
- p.end_group(step, end)
+ p.end_group(step, end)
return inner
@@ -634,11 +634,11 @@ def _super_pprint(obj, p, cycle):
p.pretty(obj.__thisclass__)
p.text(',')
p.breakable()
- if PYPY: # In PyPy, super() objects don't have __self__ attributes
- dself = obj.__repr__.__self__
- p.pretty(None if dself is obj else dself)
- else:
- p.pretty(obj.__self__)
+ if PYPY: # In PyPy, super() objects don't have __self__ attributes
+ dself = obj.__repr__.__self__
+ p.pretty(None if dself is obj else dself)
+ else:
+ p.pretty(obj.__self__)
p.end_group(8, '>')
@@ -672,10 +672,10 @@ def _type_pprint(obj, p, cycle):
# Heap allocated types might not have the module attribute,
# and others may set it to None.
- # Checks for a __repr__ override in the metaclass. Can't compare the
- # type(obj).__repr__ directly because in PyPy the representation function
- # inherited from type isn't the same type.__repr__
- if [m for m in _get_mro(type(obj)) if "__repr__" in vars(m)][:1] != [type]:
+ # Checks for a __repr__ override in the metaclass. Can't compare the
+ # type(obj).__repr__ directly because in PyPy the representation function
+ # inherited from type isn't the same type.__repr__
+ if [m for m in _get_mro(type(obj)) if "__repr__" in vars(m)][:1] != [type]:
_repr_pprint(obj, p, cycle)
return
@@ -762,15 +762,15 @@ _type_pprinters = {
}
try:
- # In PyPy, types.DictProxyType is dict, setting the dictproxy printer
- # using dict.setdefault avoids overwritting the dict printer
- _type_pprinters.setdefault(types.DictProxyType,
- _dict_pprinter_factory('dict_proxy({', '})'))
+ # In PyPy, types.DictProxyType is dict, setting the dictproxy printer
+ # using dict.setdefault avoids overwritting the dict printer
+ _type_pprinters.setdefault(types.DictProxyType,
+ _dict_pprinter_factory('dict_proxy({', '})'))
_type_pprinters[types.ClassType] = _type_pprint
_type_pprinters[types.SliceType] = _repr_pprint
except AttributeError: # Python 3
- _type_pprinters[types.MappingProxyType] = \
- _dict_pprinter_factory('mappingproxy({', '})')
+ _type_pprinters[types.MappingProxyType] = \
+ _dict_pprinter_factory('mappingproxy({', '})')
_type_pprinters[slice] = _repr_pprint
try: