Re: one more exception newbie query

2010-06-04 Thread Alf P. Steinbach
* Payal, on 04.06.2010 12:10: Hi all, In http://docs.python.org/tutorial/errors.html#handling-exceptions it says, |>>> try: | ...raise Exception('spam', 'eggs') Why would I want to use a class for exception? I could simply use raise w/o it? Also the help() says, class Exception(BaseExcepti

Re: one more exception newbie query

2010-06-04 Thread Payal
Hi, I will continue this problem here & take the next to the tutor list. On Fri, Jun 04, 2010 at 03:22:35AM -0700, Chris Rebert wrote: > `raise Foo, "whatever"` and `raise Foo("whatever")` do the same thing; > the former is deprecated though as it's been removed from Python 3.x Actually I thought

Re: one more exception newbie query

2010-06-04 Thread Chris Rebert
On Fri, Jun 4, 2010 at 3:10 AM, Payal wrote: > Hi all, > In http://docs.python.org/tutorial/errors.html#handling-exceptions it > says, > > | >>> try: > | ...    raise Exception('spam', 'eggs') > > Why would I want to use a class for exception? I could simply use raise > w/o it? `raise Foo, "whate

one more exception newbie query

2010-06-04 Thread Payal
Hi all, In http://docs.python.org/tutorial/errors.html#handling-exceptions it says, | >>> try: | ...raise Exception('spam', 'eggs') Why would I want to use a class for exception? I could simply use raise w/o it? Also the help() says, class Exception(BaseException) But we have used 'spam' and