Mercurial > public > mercurial-scm > hg
comparison mercurial/pycompat.py @ 48946:642e31cb55f0
py3: use class X: instead of class X(object):
The inheritance from object is implied in Python 3. So this should
be equivalent.
This change was generated via an automated search and replace. So there
may have been some accidental changes.
Differential Revision: https://phab.mercurial-scm.org/D12352
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Mon, 21 Feb 2022 13:08:28 -0700 |
parents | 6000f5b25c9b |
children | 9ac1a4507bb3 |
comparison
equal
deleted
inserted
replaced
48945:55d132525155 | 48946:642e31cb55f0 |
---|---|
161 >>> s = bytestr(b'foo') | 161 >>> s = bytestr(b'foo') |
162 >>> assert s is bytestr(s) | 162 >>> assert s is bytestr(s) |
163 | 163 |
164 __bytes__() should be called if provided: | 164 __bytes__() should be called if provided: |
165 | 165 |
166 >>> class bytesable(object): | 166 >>> class bytesable: |
167 ... def __bytes__(self): | 167 ... def __bytes__(self): |
168 ... return b'bytes' | 168 ... return b'bytes' |
169 >>> bytestr(bytesable()) | 169 >>> bytestr(bytesable()) |
170 'bytes' | 170 'bytes' |
171 | 171 |