Re: Exception style (was: calling python functions using variables)

2006-05-20 Thread Carl Banks
Dennis Lee Bieber wrote: > On Fri, 19 May 2006 14:41:13 +, [EMAIL PROTECTED] (Cameron Laird) > declaimed the following in comp.lang.python: . > > Guys, I try--I try *hard*--to accept the BetterToAskForgiveness > > gospel, but this situation illustrates the discomfort I consistently > >

Re: Exception style (was: calling python functions using variables)

2006-05-20 Thread Carl Banks
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

Re: Exception style

2006-05-19 Thread Ben Finney
"Fredrik Lundh" <[EMAIL PROTECTED]> writes: > Cameron Laird wrote: > > 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 p

Re: Exception style

2006-05-19 Thread bruno at modulix
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 eva

Re: Exception style (was: calling python functions using variables)

2006-05-19 Thread Richie Hindle
[Cameron] > try: > getattr(commands, VARIABLE)() > except NameError: > print >> sys.stderr, "Unknown command", VARIABLE > > 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

Re: Exception style (was: calling python functions using variables)

2006-05-19 Thread Fredrik Lundh
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