Exception style

bruno at modulix onurb at xiludom.gro
Fri May 19 14:02:58 EDT 2006


Fredrik Lundh wrote:
> Cameron Laird wrote:
> 
> 
>>Guys, I try--I try *hard*--to accept the BetterToAskForgiveness
>>gospel, but this situation illustrates the discomfort I consistently
>>feel:  how do I know that the NameError means VARIABLE didn't resolve,
>>rather than that it did, but that evaluation of commands.VARIABLE()
>>itself didn't throw a NameError?  My usual answer:  umm, unless I go
>>to efforts to prevent it, I *don't* know that didn't happen.
> 
> 
> two notes:
> 
> 1) getattr() raises an AttributeError if the attribute doesn't exist, not a NameError.

oops ! My bad :(


-- 
bruno desthuilliers
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 mailing list