t's workable. I can even cheat and rename the Cleanup class to
"Break" for clarity.
I'm guessing that there is not much support for functionality like
this to be built in, in a much less verbose manner, like the
"for...else" functionality? :P
On 6/2/15, Jean-Michel Pic
a separate function.)
On 6/2/15, Jean-Michel Pichavant wrote:
> - Original Message -
>> From: "acdr"
>> To: python-list@python.org
>> Sent: Tuesday, 2 June, 2015 1:26:42 PM
>> Subject: for...else
>>
>> Hi,
>>
>> Currently, in
Hi,
Currently, in various places in my code, I have the equivalent of:
for x in it:
if complicated_calculation_1():
cleanup()
break
complicated_calculation_2()
if complicated_calculation_3():
cleanup()
break
Obviously, I'm repeating myself by having tw