Terry Reedy writes:
I do not have any information on the topic, but I *imagine* that the
when RETURN_VALUE opcode is evaluated within the context of an except
block, it triggers a check for whether a corresponding finally block
exists and should it exist, it is triggered, much like a callback.
So
On 1/30/2014 7:05 AM, Dave Angel wrote:
Jessica Ross Wrote in message:
I found something like this in a StackOverflow discussion.
def paradox():
... try:
... raise Exception("Exception raised during try")
... except:
... print "Except after try"
...
On 01/30/2014 10:12 AM, Rotwang wrote:
On 30/01/2014 06:33, Andrew Berg wrote:
On 2014.01.29 23:56, Jessica Ross wrote:
I found something like this in a StackOverflow discussion.
--> def paradox():
... try:
... raise Exception("Exception raised during try")
... except:
...
On 30/01/2014 06:33, Andrew Berg wrote:
On 2014.01.29 23:56, Jessica Ross wrote:
I found something like this in a StackOverflow discussion.
def paradox():
... try:
... raise Exception("Exception raised during try")
... except:
... print "Except after try"
...
On Fri, Jan 31, 2014 at 12:11 AM, MRAB wrote:
> One of the reasons that the 'with' statement was added was to prevent
> the mistake that you've just done. ;-)
>
> What if the file can't be opened?
Yeah, whoops. The open shouldn't be inside try/finally.
def func():
output = open("output.txt",
On 2014-01-30 13:02, Chris Angelico wrote:
On Thu, Jan 30, 2014 at 11:05 PM, Dave Angel wrote:
The finally has to happen before any return inside the try or the
except. And once you're in the finally clause you'll finish it
before resuming the except clause. Since it has a return, that
wi
On Thu, Jan 30, 2014 at 11:05 PM, Dave Angel wrote:
> The finally has to happen before any return inside the try or the
> except. And once you're in the finally clause you'll finish it
> before resuming the except clause. Since it has a return, that
> will happen before the other returns. Th
Le jeudi 30 janvier 2014 06:56:16 UTC+1, Jessica Ross a écrit :
> I found something like this in a StackOverflow discussion.
>
> >>> def paradox():
>
> ... try:
>
> ... raise Exception("Exception raised during try")
>
> ... except:
>
> ... print "Except after tr
On 2014.01.29 23:56, Jessica Ross wrote:
> I found something like this in a StackOverflow discussion.
def paradox():
> ... try:
> ... raise Exception("Exception raised during try")
> ... except:
> ... print "Except after try"
> ... return True
> ...
On Jan 29, 2014 11:01 PM, "Jessica Ross" wrote:
>
> I found something like this in a StackOverflow discussion.
> >>> def paradox():
> ... try:
> ... raise Exception("Exception raised during try")
> ... except:
> ... print "Except after try"
> ... return
I found something like this in a StackOverflow discussion.
>>> def paradox():
... try:
... raise Exception("Exception raised during try")
... except:
... print "Except after try"
... return True
... finally:
... print "Finally"
...
11 matches
Mail list logo