Checking the boolean value of a collection

Marco Bizzarri marco.bizzarri at gmail.com
Fri Sep 12 10:18:05 EDT 2008


On Fri, Sep 12, 2008 at 4:09 PM, Diez B. Roggisch <deets at nospam.web.de> wrote:
> Marco Bizzarri schrieb:
>>
>> Hi all.
>>
>> In many parts of my code I've the following schema of code:
>>
>>    def isInUseByOutgoingRegistrations(self, archivefolder):
>>        for instance in self.findActiveOutgoingRegistrationInstances():
>>            if instance.forbidToClose(archivefolder):
>>                return True
>>        return False
>>
>> Before devising my own solution for this kind of problem, I wonder if
>> there is a common solution for the problem. I'm looking for a
>> python2.3 solution.
>
> if any(instance.forbitToClose(archivefolder) for instance in
> self.findActiveOutgoingRegistrationInstances())

Can you clarify where I can find "any"? It seems to me I'm unable to find it...


> You should also consider using PEP8 style naming.
>

I knew that someone would have said that to me :-).

I'm doing that... slowly. I'm trying to fix naming conventions as I
had to work on my code...

> Diez
> --
> http://mail.python.org/mailman/listinfo/python-list
>



-- 
Marco Bizzarri
http://notenotturne.blogspot.com/
http://iliveinpisa.blogspot.com/



More information about the Python-list mailing list