Author vstinner
Recipients Todd Dembrey, belopolsky, berker.peksag, jleedev, matrixise, ncoghlan, pitrou, rhettinger, serhiy.storchaka, torsten, vstinner
Date 2017-06-12.09:14:25
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1497258866.18.0.762537510215.issue11822@psf.upfronthosting.co.za>
In-reply-to
Content
Thanks Serhiy, it works and I like the result :-)

>>> def f():
...  def g():
...   return 3
...  return g
... 

>>> import dis; dis.dis(f)
  2           0 LOAD_CONST               1 (<code object g at 0x7f16ab2e2c40, file "<stdin>", line 2>)
              2 LOAD_CONST               2 ('f.<locals>.g')
              4 MAKE_FUNCTION            0
              6 STORE_FAST               0 (g)

  4           8 LOAD_FAST                0 (g)
             10 RETURN_VALUE

Disassembly of <code object g at 0x7f16ab2e2c40, file "<stdin>", line 2>:
  3           0 LOAD_CONST               1 (3)
              2 RETURN_VALUE
History
Date User Action Args
2017-06-12 09:14:26vstinnersetrecipients: + vstinner, rhettinger, ncoghlan, belopolsky, pitrou, torsten, berker.peksag, serhiy.storchaka, jleedev, matrixise, Todd Dembrey
2017-06-12 09:14:26vstinnersetmessageid: <1497258866.18.0.762537510215.issue11822@psf.upfronthosting.co.za>
2017-06-12 09:14:26vstinnerlinkissue11822 messages
2017-06-12 09:14:25vstinnercreate