comparison mercurial/utils/cborutil.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 bce8f66d3045
children
comparison
equal deleted inserted replaced
48945:55d132525155 48946:642e31cb55f0
481 self.islast = last 481 self.islast = last
482 482
483 return self 483 return self
484 484
485 485
486 class sansiodecoder(object): 486 class sansiodecoder:
487 """A CBOR decoder that doesn't perform its own I/O. 487 """A CBOR decoder that doesn't perform its own I/O.
488 488
489 To use, construct an instance and feed it segments containing 489 To use, construct an instance and feed it segments containing
490 CBOR-encoded bytes via ``decode()``. The return value from ``decode()`` 490 CBOR-encoded bytes via ``decode()``. The return value from ``decode()``
491 indicates whether a fully-decoded value is available, how many bytes 491 indicates whether a fully-decoded value is available, how many bytes
974 l = list(self._decodedvalues) 974 l = list(self._decodedvalues)
975 self._decodedvalues = [] 975 self._decodedvalues = []
976 return l 976 return l
977 977
978 978
979 class bufferingdecoder(object): 979 class bufferingdecoder:
980 """A CBOR decoder that buffers undecoded input. 980 """A CBOR decoder that buffers undecoded input.
981 981
982 This is a glorified wrapper around ``sansiodecoder`` that adds a buffering 982 This is a glorified wrapper around ``sansiodecoder`` that adds a buffering
983 layer. All input that isn't consumed by ``sansiodecoder`` will be buffered 983 layer. All input that isn't consumed by ``sansiodecoder`` will be buffered
984 and concatenated with any new input that arrives later. 984 and concatenated with any new input that arrives later.