mercurial/pycompat.py
changeset 48946 642e31cb55f0
parent 48875 6000f5b25c9b
child 48959 9ac1a4507bb3
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