Ray.Allen <ysj....@gmail.com> added the comment:

> That's good if it's so... can you explain why list_clear doesn't 
> guarantee that the list is empty? Why would XDECREF populate the list? 
> I don't quite understand it.


Does this mean that durning the Py_DECREF progress the list may be populated 
again? It's not a problem. Here is the simplest example(with applying eli's 
patch):


class A(object):
    def __init__(self, li):
        self._li = li
    def __del__(self):
        self._li.append(self)

li = []
li.append(A(li))
li.clear()
print(li)

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue10516>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to