Is this a legal / acceptable statement ?
bruno at modulix
onurb at xiludom.gro
Fri May 5 16:55:26 CEST 2006
Philippe Martin wrote:
> l_init really is a boolean parameter and l_value a value that _might_ exist
> in a shelve.
> So I just want to have a parameter to a method so if the first value tested
> is false (l_init) then the second (l_value) does not get tested ... because
> it is the second in the statement and only seems to get evaluated if the
> first one is true.
s/seems to get/is/
But this is a really unpythonic way to do things IMHO. Either use a
try/except block (probably the most straightforward solution), or, as in
Larry's post, test for the existence of 'l_value' in locals().
My 2 cents...
python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for
p in 'onurb at xiludom.gro'.split('@')])"
More information about the Python-list