##// END OF EJS Templates
stringutil: make pprint() forward uninteresting object to b'%r'...
Yuya Nishihara -
r37960:af83a0ed default
parent child Browse files
Show More
@@ -40,18 +40,10 b' def pprint(o, bprefix=True):'
40 '%s: %s' % (pprint(k, bprefix=bprefix),
40 '%s: %s' % (pprint(k, bprefix=bprefix),
41 pprint(v, bprefix=bprefix))
41 pprint(v, bprefix=bprefix))
42 for k, v in sorted(o.items())))
42 for k, v in sorted(o.items())))
43 elif isinstance(o, bool):
44 return b'True' if o else b'False'
45 elif isinstance(o, int):
46 return '%d' % o
47 elif isinstance(o, float):
48 return '%f' % o
49 elif isinstance(o, tuple):
43 elif isinstance(o, tuple):
50 return '(%s)' % (b', '.join(pprint(a, bprefix=bprefix) for a in o))
44 return '(%s)' % (b', '.join(pprint(a, bprefix=bprefix) for a in o))
51 elif o is None:
52 return b'None'
53 else:
45 else:
54 raise error.ProgrammingError('do not know how to format %r' % o)
46 return pycompat.byterepr(o)
55
47
56 def binary(s):
48 def binary(s):
57 """return true if a string is binary data"""
49 """return true if a string is binary data"""
General Comments 0
You need to be logged in to leave comments. Login now