Re: [Tutor] Question about exception

2007-04-05 Thread Mike Hansen
> If the Exception is defined as a class, e will be an instance of > that class so you can have pretty much anything available: > > class MyException(Exception): > def __init__(self, msg, mylist) > self.msg = msg > self.mylist = mylist > Exception.__init__(self, msg) >

Re: [Tutor] Question about exception

2007-04-05 Thread Bill Campbell
On Thu, Apr 05, 2007, Mike Hansen wrote: >When doing a try/except block, is it possible to return a list as part >of the exception? > >try: >check_someting() >except CheckSomethingError, e: >for each_error in e: > # do something > >Can 'e' be a list of errors? If so, how do you constr

[Tutor] Question about exception

2007-04-05 Thread Mike Hansen
When doing a try/except block, is it possible to return a list as part of the exception? try: check_someting() except CheckSomethingError, e: for each_error in e: # do something Can 'e' be a list of errors? If so, how do you construct your exception class? Is it better to do it l

Re: [Tutor] Question about exception handling

2006-12-17 Thread Adam Bark
On 17/12/06, Asrarahmed Kadri <[EMAIL PROTECTED]> wrote: Hi Folks, Is it possible to catch exception raised in module A to be caught in module B. If yes, then please let me know how to do it. You can easily test this yourself. First right a quick module, something like this will do: def e

[Tutor] Question about exception handling

2006-12-17 Thread Asrarahmed Kadri
Hi Folks, Is it possible to catch exception raised in module A to be caught in module B. If yes, then please let me know how to do it. TIA. Regards, Asrarahmed Kadri -- To HIM you shall return. ___ Tutor maillist - Tutor@python.org http://mail.p