Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #105001

Re: empty clause of for loops

From "Sven R. Kunze" <srkunze@mail.de>
Newsgroups comp.lang.python
Subject Re: empty clause of for loops
Date 2016-03-16 11:36 +0100
Message-ID <mailman.188.1458124572.12893.python-list@python.org> (permalink)
References <56E93413.6090108@mail.de> <DB5PR07MB149603DF925D4DA9DC564D77F08A0@DB5PR07MB1496.eurprd07.prod.outlook.com>

Show all headers | View raw


On 16.03.2016 11:28, Joaquin Alzola wrote:
> If len(my_iterable) is not 0:
>      for x in my_iterable:
>          # do
> else:
>       # do something else

I am sorry, I should have been more precise here.

my_iterable is an iterator that's exhausted after a complete iteration 
and cannot be restored.
It's furthermore too large to fit into memory completely.

Best,
Sven

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: empty clause of for loops "Sven R. Kunze" <srkunze@mail.de> - 2016-03-16 11:36 +0100

csiph-web