提交 bcfff4fc 编写于 作者: D Damien George

tests/basics/iter1.py: Add more tests for walking a user-defined iter.

Some code in mp_iternext() was only tested by the native emitter, so the
tests added here test this function using just the bytecode emitter.
上级 f50b64ca
......@@ -68,3 +68,12 @@ except StopIteration:
for i in myiter(32):
print(i)
# repeat some of the above tests but use tuple() to walk the iterator (tests mp_iternext)
print(tuple(myiter(5)))
print(tuple(myiter(12)))
print(tuple(myiter(32)))
try:
tuple(myiter(22))
except TypeError:
print('raised TypeError')
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册