Re: Checking the boolean value of a collection
Marco Bizzarri wrote:
Yes. Now I can read it to suggest shorter names (I agree with FL here).
I would consider 'outgoing' for 'a_o_r_i' and perhaps 'no_close' or
'stay_open' or suggestions below for 'f_t_c'
Does one of 'locked', 'forbidden', 'untouchable' express the essence of
the condition being tested? I would consider using the same adjective
to name the test on instances and the collection of instances, or maybe
'x' and 'any_x'.
Anyway, I'm trying a good
tjr
Marco Bizzarri wrote:
On Fri, Sep 12, 2008 at 4:09 PM, Diez B. Roggisch <deets@nospam.w eb.dewrote:
>
>
>
class FolderInUse:
>
def __init__(self, core):
self.core = core
>
def true_for(self, archivefolder):
return any([instance.forbid _to_close(archi vefolder) for instance in
self.core.activ e_outgoing_regi stration_instan ces()])
>
Is this any better?
>
>You should also consider using PEP8 style naming.
>>
>>
>Diez
>>
>>
>Diez
>
class FolderInUse:
>
def __init__(self, core):
self.core = core
>
def true_for(self, archivefolder):
return any([instance.forbid _to_close(archi vefolder) for instance in
self.core.activ e_outgoing_regi stration_instan ces()])
>
Is this any better?
I would consider 'outgoing' for 'a_o_r_i' and perhaps 'no_close' or
'stay_open' or suggestions below for 'f_t_c'
The true_for name does not satisfy me a lot...
maybe because it is too similar to True.
maybe because it is too similar to True.
the condition being tested? I would consider using the same adjective
to name the test on instances and the collection of instances, or maybe
'x' and 'any_x'.
Anyway, I'm trying a good
naming so that code is readable, like:
>
specification = FolderInUse(cor e)
>
if specification.t rue_for(folder) :
...
>
Any thought about this?
>
specification = FolderInUse(cor e)
>
if specification.t rue_for(folder) :
...
>
Any thought about this?
Comment