while expression feature proposal
Paul Rubin
no.email at nospam.invalid
Wed Oct 24 19:08:21 EDT 2012
More information about the Python-list mailing list
Wed Oct 24 19:08:21 EDT 2012
- Previous message (by thread): while expression feature proposal
- Next message (by thread): while expression feature proposal
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Ian Kelly <ian.g.kelly at gmail.com> writes: > j = int(random() * n) > while j in selected: > j = int(random() * n) from itertools import dropwhile j = dropwhile(lambda j: j in selected, iter(lambda: int(random() * n), object())) .next() kind of ugly, makes me wish for a few more itertools primitives, but I think it expresses reasonably directly what you are trying to do.
- Previous message (by thread): while expression feature proposal
- Next message (by thread): while expression feature proposal
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list