On 10/20/05, Daniel <[EMAIL PROTECTED]> wrote:
> The problem is, there's no explicit condition in a try/except block.
> Any statement after try before except may throw an exception that may
> or may not be caught by the except clause. It's less clear how the
> program will actually run than if/else.

You'll have no argument from me on that one.

> Also, sometime in the future Python may not support raising classes
> that are not  derived from Exception (I read that somewhere, but can't
> remember where--I think it was a PEP)--that would mean the TG raise
> redirect would not work. Not to mention, it doesn't seem very Pythonic
> to be raising some class that is not an error--it's just not the one
> obvious way.

Of course, it's easy enough to just make HTTPRedirect descend from Exception :)

> Finally, although I think it's a bad idea to use this as the sole
> reason for ruling something out, raising/catching an exception is less
> performant than using a simple if/else due to the overhead of the
> exception handling mechanism.

It must not be too bad, given that iterators work by raising an
exception when they're done. I agree that you probably wouldn't want a
tight loop of exception raising, though.

Kevin

--
Kevin Dangoor
Author of the Zesty News RSS newsreader

email: [EMAIL PROTECTED]
company: http://www.BlazingThings.com
blog: http://www.BlueSkyOnMars.com

Reply via email to