Message231229
This has come up once before and it was rejected for several reasons including the one David mentioned.
In Python, code reads more clearly with the usual:
for elem in iterable:
if elem not in seen:
seen.add(elem)
do_something(elem)
Than with:
for elem in iterable:
if not seen.add(elem):
do_something(elem)
That latter is less self-evident about what it does.
Also, I think there were lessons drawn from Guido's decision to not incorporate the C-language feature of both assigning and testing in a conditional:
while((c = fgetc(fp)) != EOF) |
|
Date |
User |
Action |
Args |
2014-11-16 00:53:38 | rhettinger | set | recipients:
+ rhettinger, r.david.murray, brechtm |
2014-11-16 00:53:37 | rhettinger | set | messageid: <1416099217.97.0.149106761276.issue22879@psf.upfronthosting.co.za> |
2014-11-16 00:53:37 | rhettinger | link | issue22879 messages |
2014-11-16 00:53:37 | rhettinger | create | |
|