diff options
author | INADA Naoki <songofacandy@gmail.com> | 2011-01-30 10:45:39 +0900 |
---|---|---|
committer | INADA Naoki <songofacandy@gmail.com> | 2011-01-30 10:45:39 +0900 |
commit | af7113bb31877f337eef3d43048c0a9f1cb74258 (patch) | |
tree | 900b4b54b5167c3964f6190c9e3bac28efa0aaee /msgpack/_msgpack.pyx | |
parent | 60d3ce3a180789ef5f57c22dd579c383ea7eed91 (diff) | |
download | msgpack-python-af7113bb31877f337eef3d43048c0a9f1cb74258.tar.gz |
python: Remove UnpackIterator. Unpacker is iterator of itself.
Diffstat (limited to 'msgpack/_msgpack.pyx')
-rw-r--r-- | msgpack/_msgpack.pyx | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/msgpack/_msgpack.pyx b/msgpack/_msgpack.pyx index e367444..cdcd0c8 100644 --- a/msgpack/_msgpack.pyx +++ b/msgpack/_msgpack.pyx @@ -205,18 +205,6 @@ def unpack(object stream, object object_hook=None, object list_hook=None, bint u return unpackb(stream.read(), use_list=use_list, object_hook=object_hook, list_hook=list_hook) -cdef class UnpackIterator(object): - cdef object unpacker - - def __init__(self, unpacker): - self.unpacker = unpacker - - def __next__(self): - return self.unpacker.unpack() - - def __iter__(self): - return self - cdef class Unpacker(object): """Unpacker(read_size=1024*1024) @@ -347,7 +335,10 @@ cdef class Unpacker(object): raise ValueError("Unpack failed: error = %d" % (ret,)) def __iter__(self): - return UnpackIterator(self) + return self + + def __next__(self): + return self.unpack() # for debug. #def _buf(self): |