[Baypiggies] Python way to avoid usage of raise
Nick S Kanakakorn
bbdada at gmail.com
Thu Oct 7 22:57:33 CEST 2010
The rules changed after one day. Now, I can use exception again.
Off topics: if python have command alias, I can say 'alias error raise'
On Wed, Oct 6, 2010 at 2:28 PM, Brent Tubbs <brent.tubbs at gmail.com> wrote:
> Nick: Is your boss likely to notice something like this?
> class TotallyNotAnExceptionNothingToSeeHere(Exception):
> raise TotallyNotAnExceptionNothingToSeeHere("Really, pay me no attention")
> brent at greta:~/tmp$ python except.py
> Traceback (most recent call last):
> File "except.py", line 4, in <module>
> raise TotallyNotAnExceptionNothingToSeeHere("Really, pay me no
> __main__.TotallyNotAnExceptionNothingToSeeHere: Really, pay me no attention
> Kidding.... mostly. The "no exceptions" rule just seems really arbitrary.
> On Wed, Oct 6, 2010 at 8:01 AM, Andrew Dalke <dalke at dalkescientific.com>
> > On Oct 5, 2010, at 9:57 PM, James Tatum wrote:
> >> I've seen this anti-pattern up close. There is no Pythonic answer -
> >> exceptions are the answer.
> > There is a Pythonic answer - you can go the Twisted route.
> > (Excepting those who think Twisted isn't Pythonic. ;)
> > Twisted's Deferreds can't use the stack because they
> > implement continuations through callback methods. You
> > "addCallback" for the normal case and "addErrback" for the
> > exceptions.
> > It's possible to develop your entire code base this way.
> > It's going to be structured entirely different than what
> > the OP's more senior rule mandator expects, but that might
> > be a good thing here.
> > Andrew
> > dalke at dalkescientific.com
> > _______________________________________________
> > Baypiggies mailing list
> > Baypiggies at python.org
> > To change your subscription options or unsubscribe:
> > http://mail.python.org/mailman/listinfo/baypiggies
> Baypiggies mailing list
> Baypiggies at python.org
> To change your subscription options or unsubscribe:
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Baypiggies