Changes between Initial Version and Version 1 of Ticket #97, comment 12


Ignore:
Timestamp:
2012-08-06T18:59:01Z (13 years ago)
Author:
davidsarah
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #97, comment 12

    initial v1  
    44You are right to be suspicious: in CPython closures keep a reference to the entire enclosing frame. See Owen S.'s answer at http://stackoverflow.com/questions/3145893/how-are-closures-implemented-in-python .
    55
    6 BTW, this approach not only leads to memory leaks, but also gives the wrong -- or at least, unexpected by most programmers -- semantics for captured mutable variables. And since changing that would be an incompatible change, it's not likely that either the memory leaks or the semantics will be fixed.
     6BTW, this approach not only leads to memory leaks, but also ~~gives the wrong -- or at least, unexpected by most programmers --~~ affects the semantics for captured mutable variables. And since changing that would be an incompatible change, it's not likely that either the memory leaks or the semantics will be fixed.