Re: How to use self-inspection to check for try-block

2009-03-20 Thread Diez B. Roggisch
el...@cmbi.ru.nl schrieb: On Mar 20, 10:16 am, Chris Rebert wrote: On Fri, Mar 20, 2009 at 2:09 AM, wrote: On Mar 20, 9:44 am, Chris Rebert wrote: On Fri, Mar 20, 2009 at 1:32 AM, wrote: Hi everyone, is there a sufficiently easy possibility for a Python function to find out whether it h

Re: How to use self-inspection to check for try-block

2009-03-20 Thread elmar
On Mar 20, 10:16 am, Chris Rebert wrote: > On Fri, Mar 20, 2009 at 2:09 AM, wrote: > > On Mar 20, 9:44 am, Chris Rebert wrote: > >> On Fri, Mar 20, 2009 at 1:32 AM, wrote: > >> > Hi everyone, > > >> > is there a sufficiently easy possibility for a Python function to find > >> > out whether it

Re: How to use self-inspection to check for try-block

2009-03-20 Thread Chris Rebert
On Fri, Mar 20, 2009 at 2:09 AM, wrote: > On Mar 20, 9:44 am, Chris Rebert wrote: >> On Fri, Mar 20, 2009 at 1:32 AM,   wrote: >> > Hi everyone, >> >> > is there a sufficiently easy possibility for a Python function to find >> > out whether it has been called from a try-block or not? >> >> > try

Re: How to use self-inspection to check for try-block

2009-03-20 Thread elmar
On Mar 20, 9:44 am, Chris Rebert wrote: > On Fri, Mar 20, 2009 at 1:32 AM, wrote: > > Hi everyone, > > > is there a sufficiently easy possibility for a Python function to find > > out whether it has been called from a try-block or not? > > > try: > > print "Calling foo" > > foo() > > except: >

Re: How to use self-inspection to check for try-block

2009-03-20 Thread Chris Rebert
On Fri, Mar 20, 2009 at 1:32 AM, wrote: > Hi everyone, > > is there a sufficiently easy possibility for a Python function to find > out whether it has been called from a try-block or not? > > try: >  print "Calling foo" >  foo() > except: >  print "Got exception" > > In the example above, foo() s

How to use self-inspection to check for try-block

2009-03-20 Thread elmar
Hi everyone, is there a sufficiently easy possibility for a Python function to find out whether it has been called from a try-block or not? try: print "Calling foo" foo() except: print "Got exception" In the example above, foo() should be able to 'see' that it was called from a try block,