diff options
author | INADA Naoki <songofacandy@gmail.com> | 2015-01-27 14:04:32 +0900 |
---|---|---|
committer | INADA Naoki <songofacandy@gmail.com> | 2015-01-27 14:04:32 +0900 |
commit | 4576b94b6c9c641bfa29a1d161968822d6e67d19 (patch) | |
tree | 6dfd21a4382d42e6c09a52c9cfbfd9e9520bdab0 | |
parent | 3f5e0582648b04c2b3e6663ed946462b3d7df02e (diff) | |
download | msgpack-python-4576b94b6c9c641bfa29a1d161968822d6e67d19.tar.gz |
fallback: Add some comment to Unpacker members.
-rw-r--r-- | msgpack/fallback.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/msgpack/fallback.py b/msgpack/fallback.py index bd99a15..235c201 100644 --- a/msgpack/fallback.py +++ b/msgpack/fallback.py @@ -187,10 +187,16 @@ class Unpacker(object): raise TypeError("`file_like.read` must be callable") self.file_like = file_like self._fb_feeding = False + + #: array of bytes feeded. self._fb_buffers = [] - self._fb_buf_o = 0 + #: Which buffer we currently reads self._fb_buf_i = 0 + #: Which position we currently reads + self._fb_buf_o = 0 + #: Total size of _fb_bufferes self._fb_buf_n = 0 + # When Unpacker is used as an iterable, between the calls to next(), # the buffer is not "consumed" completely, for efficiency sake. # Instead, it is done sloppily. To make sure we raise BufferFull at @@ -199,6 +205,7 @@ class Unpacker(object): # we raise an OutOfData) we need to rollback the buffer to the correct # state, which _fb_slopiness records. self._fb_sloppiness = 0 + self._max_buffer_size = max_buffer_size or 2**31-1 if read_size > self._max_buffer_size: raise ValueError("read_size must be smaller than max_buffer_size") |