Message112896
I verified with 3.1 the two OP cases and that generators work fine as long as they supply the correct number of values.
def f(x): return x
def broken(): return 1
print(f(*(broken() for x in (0,))))
# prints 1
Change (0,) to (0,1) the normal arg num mismatch message appears.
test_extcall tests version of Nothing() that follow both the old and new iteration protocol. It is possible that 'sequence' in meant in the broader sense of finite iterable rather that the narrow sense of
5.6. Sequence Types — str, bytes, bytearray, list, tuple, range
Since that is confusing, I would replace 'sequence' with 'finite iterable'. (Infinite iterables, obviously, are bad, just as in any other uncontrolled situation, such as "a,*b = itertools.count()".)
So, combine the correction and the suggestion above with original and diff against current trunk (py3k branch) if you can or at least 3.1.2. |
|
Date |
User |
Action |
Args |
2010-08-04 21:08:11 | terry.reedy | set | recipients:
+ terry.reedy, amaury.forgeotdarc, dangyogi, hagen, kcarnold |
2010-08-04 21:08:11 | terry.reedy | set | messageid: <1280956091.22.0.919604071806.issue4806@psf.upfronthosting.co.za> |
2010-08-04 21:08:09 | terry.reedy | link | issue4806 messages |
2010-08-04 21:08:09 | terry.reedy | create | |
|