query regarding python script

Diez B. Roggisch deetsNOSPAM at web.de
Thu May 20 10:32:45 EDT 2004


Shubhra Gupta wrote:

> 
> 
>> Hi,
>> 
>> I have the following statement in one my python script :-
>> 
>> assert not opt_initialize or os.path.exists(initdir), "initialize implies
>> init directory"

As the or-operator is non-strict, the right side of it gets only evaluated
if the left is False. So the comment pretty much says it: If opt_initialize
is True, the not negates it and then the os.path.exists(initdir) is
executed - but orly then.
-- 
Regards,

Diez B. Roggisch



More information about the Python-list mailing list