Add method to get buffer map (debug)

This commit is contained in:
Oleksii Shevchuk 2018-03-11 20:57:35 +02:00
parent 9b9633e255
commit 04ff12db62
1 changed files with 10 additions and 0 deletions

View File

@ -447,6 +447,16 @@ class Buffer(object):
del self._data[:todel]
def chunksinfo(self):
result = ''
if self._bofft:
result = "+{}:".format(self._bofft)
result += ','.join(
'{}:{}'.format(len(x), type(x).__name__) for x in self._data)
return '<Buffer: {}>'.format(result)
def __len__(self):
"""Returns length of buffer. Used in len()."""
return self._len