Better writing in python

Marc 'BlackJack' Rintsch bj_666 at gmx.net
Wed Oct 24 14:46:01 CEST 2007


On Wed, 24 Oct 2007 12:09:40 +0000, Alexandre Badez wrote:

> I'm just wondering, if I could write a in a "better" way this code
> 
> lMandatory = []
> lOptional = []
> for arg in cls.dArguments:
>   if arg is True:
>     lMandatory.append(arg)
>   else:
>     lOptional.append(arg)
> return (lMandatory, lOptional)
> 
> I think there is a better way, but I can't see how...

Drop the prefixes. `l` is for list?  `d` is for what!?  Can't be
dictionary because the code doesn't make much sense.

Where is `cls` coming from?

Ciao,
	Marc 'BlackJack' Rintsch



More information about the Python-list mailing list