This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author sbt
Recipients Yury.Selivanov, asvetlov, benjamin.peterson, ncoghlan, pitrou, sbt
Date 2012-04-24.23:37:56
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1335310677.08.0.109542213437.issue14369@psf.upfronthosting.co.za>
In-reply-to
Content
The patch causes crashes.  If I define

  def cell(o):
    def f(): o
    return f.__closure__[0]

  def f():
    a = 1
    b = 2
    def g():
      return a + b
    return g

  g = f()

then I find

  g.__closure__ = None; g()                          -> crash
  g.__closure__ = (cell(3),); g()                    -> crash
  g.__closure__ = (1, 2); g()                        -> SystemError *
  g.__closure__ = (cell(3), cell(4), cell(5)); g()   -> returns 7

* SystemError: ..\Objects\cellobject.c:24: bad argument to internal function
History
Date User Action Args
2012-04-24 23:37:57sbtsetrecipients: + sbt, ncoghlan, pitrou, benjamin.peterson, asvetlov, Yury.Selivanov
2012-04-24 23:37:57sbtsetmessageid: <1335310677.08.0.109542213437.issue14369@psf.upfronthosting.co.za>
2012-04-24 23:37:56sbtlinkissue14369 messages
2012-04-24 23:37:56sbtcreate