On Apr 10, 7:19 pm, Terry Reedy wrote:
> Sylvain Thénault wrote:
> > Hi there,
>
> > I've encountered the following behaviour which I found surprising:
-
> If you say 'print test()', you shoud see None printed after 'end' (at
> least with 3.0) from the function falling off the end.
>
> The 'if Tru
Sylvain Thénault wrote:
Hi there,
I've encountered the following behaviour which I found surprising:
def test():
... for x in ('test', 'tests'):
... try:
... if True:
... print 'return'
... return 1
... finally:
...
Hi Sylvain
You should have a read of the python docs, specifically on try:
finally:
excerpt from docs. --
When a return, break or continue statement is executed in the try
suite of a try...finally statement, the finally clause is also
executed `on the way out.' A continue statement is illegal in
Hi there,
I've encountered the following behaviour which I found surprising:
>>> def test():
... for x in ('test', 'tests'):
... try:
... if True:
... print 'return'
... return 1
... finally:
... print 'break'
...