Mercurial > public > mercurial-scm > hg
comparison mercurial/utils/stringutil.py @ 37942:32bc3815efae
stringutil: flip the default of pprint() to bprefix=False
If we use pprint() as a drop-in replacement for repr(), bprefix=False is more
appropriate. Let's make it the default to remove bprefix=False noise.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Thu, 10 May 2018 21:08:32 +0900 |
parents | af83a0ed0afb |
children | f3033692ccef |
comparison
equal
deleted
inserted
replaced
37941:af83a0ed0afb | 37942:32bc3815efae |
---|---|
21 encoding, | 21 encoding, |
22 error, | 22 error, |
23 pycompat, | 23 pycompat, |
24 ) | 24 ) |
25 | 25 |
26 def pprint(o, bprefix=True): | 26 def pprint(o, bprefix=False): |
27 """Pretty print an object.""" | 27 """Pretty print an object.""" |
28 if isinstance(o, bytes): | 28 if isinstance(o, bytes): |
29 if bprefix: | 29 if bprefix: |
30 return "b'%s'" % escapestr(o) | 30 return "b'%s'" % escapestr(o) |
31 return "'%s'" % escapestr(o) | 31 return "'%s'" % escapestr(o) |