File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -317,6 +317,15 @@ def assert_matches_seq(it, seq):
317
317
assert pickle .dumps (it , 3 ) == b'\x80 \x03 citertools\n dropwhile\n q\x00 c__main__\n underten\n q\x01 cbuiltins\n iter\n q\x02 ]q\x03 (K\x01 K\x03 K\x05 K\x14 K\x02 K\x04 K\x06 K\x08 e\x85 q\x04 Rq\x05 K\x00 b\x86 q\x06 Rq\x07 K\x00 b.'
318
318
assert pickle .dumps (it , 4 ) == b'\x80 \x04 \x95 i\x00 \x00 \x00 \x00 \x00 \x00 \x00 \x8c \t itertools\x94 \x8c \t dropwhile\x94 \x93 \x94 \x8c \x08 __main__\x94 \x8c \x08 underten\x94 \x93 \x94 \x8c \x08 builtins\x94 \x8c \x04 iter\x94 \x93 \x94 ]\x94 (K\x01 K\x03 K\x05 K\x14 K\x02 K\x04 K\x06 K\x08 e\x85 \x94 R\x94 K\x00 b\x86 \x94 R\x94 K\x00 b.'
319
319
assert pickle .dumps (it , 5 ) == b'\x80 \x05 \x95 i\x00 \x00 \x00 \x00 \x00 \x00 \x00 \x8c \t itertools\x94 \x8c \t dropwhile\x94 \x93 \x94 \x8c \x08 __main__\x94 \x8c \x08 underten\x94 \x93 \x94 \x8c \x08 builtins\x94 \x8c \x04 iter\x94 \x93 \x94 ]\x94 (K\x01 K\x03 K\x05 K\x14 K\x02 K\x04 K\x06 K\x08 e\x85 \x94 R\x94 K\x00 b\x86 \x94 R\x94 K\x00 b.'
320
+ next (it )
321
+ assert pickle .dumps (it , 0 ) == b'citertools\n dropwhile\n p0\n (c__main__\n underten\n p1\n c__builtin__\n iter\n p2\n ((lp3\n I1\n aI3\n aI5\n aI20\n aI2\n aI4\n aI6\n aI8\n atp4\n Rp5\n I4\n btp6\n Rp7\n I1\n b.'
322
+ assert pickle .dumps (it , 1 ) == b'citertools\n dropwhile\n q\x00 (c__main__\n underten\n q\x01 c__builtin__\n iter\n q\x02 (]q\x03 (K\x01 K\x03 K\x05 K\x14 K\x02 K\x04 K\x06 K\x08 etq\x04 Rq\x05 K\x04 btq\x06 Rq\x07 K\x01 b.'
323
+ assert pickle .dumps (it , 2 ) == b'\x80 \x02 citertools\n dropwhile\n q\x00 c__main__\n underten\n q\x01 c__builtin__\n iter\n q\x02 ]q\x03 (K\x01 K\x03 K\x05 K\x14 K\x02 K\x04 K\x06 K\x08 e\x85 q\x04 Rq\x05 K\x04 b\x86 q\x06 Rq\x07 K\x01 b.'
324
+ assert pickle .dumps (it , 3 ) == b'\x80 \x03 citertools\n dropwhile\n q\x00 c__main__\n underten\n q\x01 cbuiltins\n iter\n q\x02 ]q\x03 (K\x01 K\x03 K\x05 K\x14 K\x02 K\x04 K\x06 K\x08 e\x85 q\x04 Rq\x05 K\x04 b\x86 q\x06 Rq\x07 K\x01 b.'
325
+ assert pickle .dumps (it , 4 ) == b'\x80 \x04 \x95 i\x00 \x00 \x00 \x00 \x00 \x00 \x00 \x8c \t itertools\x94 \x8c \t dropwhile\x94 \x93 \x94 \x8c \x08 __main__\x94 \x8c \x08 underten\x94 \x93 \x94 \x8c \x08 builtins\x94 \x8c \x04 iter\x94 \x93 \x94 ]\x94 (K\x01 K\x03 K\x05 K\x14 K\x02 K\x04 K\x06 K\x08 e\x85 \x94 R\x94 K\x04 b\x86 \x94 R\x94 K\x01 b.'
326
+ assert pickle .dumps (it , 5 ) == b'\x80 \x05 \x95 i\x00 \x00 \x00 \x00 \x00 \x00 \x00 \x8c \t itertools\x94 \x8c \t dropwhile\x94 \x93 \x94 \x8c \x08 __main__\x94 \x8c \x08 underten\x94 \x93 \x94 \x8c \x08 builtins\x94 \x8c \x04 iter\x94 \x93 \x94 ]\x94 (K\x01 K\x03 K\x05 K\x14 K\x02 K\x04 K\x06 K\x08 e\x85 \x94 R\x94 K\x04 b\x86 \x94 R\x94 K\x01 b.'
327
+ for proto in range (pickle .HIGHEST_PROTOCOL + 1 ):
328
+ assert next (pickle .loads (pickle .dumps (it , proto ))) == 2
320
329
321
330
322
331
# itertools.accumulate
You can’t perform that action at this time.
0 commit comments