Baptiste Carvello wrote:
x=0; [x:=x+i for i in range(5)]
what would be a
non-cryptic alternative to the above example?
Personally I wouldn't insist on trying to do it with a
comprehension at all, but if forced to come up with a
readable syntax for that, it would probably be something
like
[x for i in range(5) letting x = x + 1 given x = 0]
--
Greg
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com