A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2004-May/044813.html below:

[Python-Dev] Is core dump always a bug? Advice requested

[Python-Dev] Is core dump always a bug? Advice requested [Python-Dev] Is core dump always a bug? Advice requested"Martin v. Löwis" martin at v.loewis.de
Thu May 13 15:23:35 EDT 2004
Michel Pelletier wrote:
> But just looking at some code here, is RETURN_VALUE ever inside a SETUP_EXCEPT 
> block?  

What about this code:

 >>> def foo():
...   try:
...     try:
...       return 7
...     except:
...       pass
...   finally:
...     print "Hello"
...
 >>> dis.dis(foo)
   2           0 SETUP_FINALLY           22 (to 25)

   3           3 SETUP_EXCEPT             8 (to 14)

   4           6 LOAD_CONST               1 (7)
               9 RETURN_VALUE
              10 POP_BLOCK
              11 JUMP_FORWARD             7 (to 21)

   5     >>   14 POP_TOP
              15 POP_TOP
              16 POP_TOP

   6          17 JUMP_FORWARD             1 (to 21)
              20 END_FINALLY
         >>   21 POP_BLOCK
              22 LOAD_CONST               0 (None)

   8     >>   25 LOAD_CONST               2 ('Hello')
              28 PRINT_ITEM
              29 PRINT_NEWLINE
              30 END_FINALLY
              31 LOAD_CONST               0 (None)
              34 RETURN_VALUE



More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4