<feed xmlns='http://www.w3.org/2005/Atom'>
<title>python.git/Modules/gcmodule.c, branch 2.3</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.</subtitle>
<id>http://dangofactory.net/cgit/cgit.cgi/Server/python.git/atom/Modules/gcmodule.c?h=2.3</id>
<link rel='self' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/atom/Modules/gcmodule.c?h=2.3'/>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/'/>
<updated>2004-10-31T22:27:45Z</updated>
<entry>
<title>handle_weakrefs():  Simplification -- there's no need to make a second</title>
<updated>2004-10-31T22:27:45Z</updated>
<author>
<name>Tim Peters</name>
<email>tim.peters@gmail.com</email>
</author>
<published>2004-10-31T22:27:45Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=64173c87935e8914575040fa091f388bca67e327'/>
<id>urn:sha1:64173c87935e8914575040fa091f388bca67e327</id>
<content type='text'>
pass over the unreachable weakrefs-with-callbacks to unreachable objects.
</content>
</entry>
<entry>
<title>SF 1055820: weakref callback vs gc vs threads</title>
<updated>2004-10-31T00:13:07Z</updated>
<author>
<name>Tim Peters</name>
<email>tim.peters@gmail.com</email>
</author>
<published>2004-10-31T00:13:07Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=7d37a2a564c18ea4e6b66b5622cfeee56666f900'/>
<id>urn:sha1:7d37a2a564c18ea4e6b66b5622cfeee56666f900</id>
<content type='text'>
In cyclic gc, clear all weakrefs to unreachable objects before allowing any
Python code (weakref callbacks or __del__ methods) to run.

This is a critical bugfix, affecting all versions of Python since weakrefs
were introduced.
</content>
</entry>
<entry>
<title>Silence GCC warning when asserts are turned off.</title>
<updated>2003-11-24T04:02:31Z</updated>
<author>
<name>Guido van Rossum</name>
<email>guido@python.org</email>
</author>
<published>2003-11-24T04:02:31Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=5c20156349dfcae361f7565871c8590d2a30a1a6'/>
<id>urn:sha1:5c20156349dfcae361f7565871c8590d2a30a1a6</id>
<content type='text'>
</content>
</entry>
<entry>
<title>SF bug 839548:  Bug in type's GC handling causes segfaults.</title>
<updated>2003-11-20T22:13:51Z</updated>
<author>
<name>Tim Peters</name>
<email>tim.peters@gmail.com</email>
</author>
<published>2003-11-20T22:13:51Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=ca6919c1805d20533d2be8e68e2849e15aff7bf7'/>
<id>urn:sha1:ca6919c1805d20533d2be8e68e2849e15aff7bf7</id>
<content type='text'>
Also SF patch 843455.

This is a critical bugfix, backported from 2.4 development.
I don't intend to backport beyond 2.3 maint.  The bugs this fixes
have been there since weakrefs were introduced.
</content>
</entry>
<entry>
<title>- New C API PyGC_Collect(), same as calling gc.collect().</title>
<updated>2003-04-17T17:29:22Z</updated>
<author>
<name>Guido van Rossum</name>
<email>guido@python.org</email>
</author>
<published>2003-04-17T17:29:22Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=e13ddc9ec85287b17fd03454f836f495c1167de9'/>
<id>urn:sha1:e13ddc9ec85287b17fd03454f836f495c1167de9</id>
<content type='text'>
- Call this in Py_Finalize().
- Expand the Misc/NEWS text on PY_LONG_LONG.
</content>
</entry>
<entry>
<title>s/referrents/referents/g.  Gotta love that referrers remains rife with rs.</title>
<updated>2003-04-08T17:17:17Z</updated>
<author>
<name>Tim Peters</name>
<email>tim.peters@gmail.com</email>
</author>
<published>2003-04-08T17:17:17Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=730f5535ba8abf62ed580dcd605ec9a5de85d71b'/>
<id>urn:sha1:730f5535ba8abf62ed580dcd605ec9a5de85d71b</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Finished implementing gc.get_referrents():  dealt with error and end</title>
<updated>2003-04-08T16:39:48Z</updated>
<author>
<name>Tim Peters</name>
<email>tim.peters@gmail.com</email>
</author>
<published>2003-04-08T16:39:48Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=0f81ab6d8895fb6a0b09d517b872a7816060914d'/>
<id>urn:sha1:0f81ab6d8895fb6a0b09d517b872a7816060914d</id>
<content type='text'>
cases, wrote docs, added a test.
</content>
</entry>
<entry>
<title>Comment repair; no semantic changes.</title>
<updated>2003-04-07T22:41:24Z</updated>
<author>
<name>Tim Peters</name>
<email>tim.peters@gmail.com</email>
</author>
<published>2003-04-07T22:41:24Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=fb2ab4d5ae048ee29e98dee30b9f68652a34da85'/>
<id>urn:sha1:fb2ab4d5ae048ee29e98dee30b9f68652a34da85</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Reworked has_finalizer() to use the new _PyObject_Lookup() instead</title>
<updated>2003-04-07T19:21:15Z</updated>
<author>
<name>Tim Peters</name>
<email>tim.peters@gmail.com</email>
</author>
<published>2003-04-07T19:21:15Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=f6b8045ca5262f0d83eea3a279828a3f136f167f'/>
<id>urn:sha1:f6b8045ca5262f0d83eea3a279828a3f136f167f</id>
<content type='text'>
of PyObject_HasAttr(); the former promises never to execute
arbitrary Python code.  Undid many of the changes recently made to
worm around the worst consequences of that PyObject_HasAttr() could
execute arbitrary Python code.

Compatibility is hard to discuss, because the dangerous cases are
so perverse, and much of this appears to rely on implementation
accidents.

To start with, using hasattr() to check for __del__ wasn't only
dangerous, in some cases it was wrong:  if an instance of an old-
style class didn't have "__del__" in its instance dict or in any
base class dict, but a getattr hook said __del__ existed, then
hasattr() said "yes, this object has a __del__".  But
instance_dealloc() ignores the possibility of getattr hooks when
looking for a __del__, so while object.__del__ succeeds, no
__del__ method is called when the object is deleted.  gc was
therefore incorrect in believing that the object had a finalizer.

The new method doesn't suffer that problem (like instance_dealloc(),
_PyObject_Lookup() doesn't believe __del__ exists in that case), but
does suffer a somewhat opposite-- and even more obscure --oddity:
if an instance of an old-style class doesn't have "__del__" in its
instance dict, and a base class does have "__del__" in its dict,
and the first base class with a "__del__" associates it with a
descriptor (an object with a __get__ method), *and* if that
descriptor raises an exception when __get__ is called, then
(a) the current method believes the instance does have a __del__,
but (b) hasattr() does not believe the instance has a __del__.

While these disagree, I believe the new method is "more correct":
because the descriptor *will* be called when the object is
destructed, it can execute arbitrary Python code at the time the
object is destructed, and that's really what gc means by "has a
finalizer":  not specifically a __del__ method, but more generally
the possibility of executing arbitrary Python code at object
destruction time.  Code in a descriptor's __get__() executed at
destruction time can be just as problematic as code in a
__del__() executed then.

So I believe the new method is better on all counts.

Bugfix candidate, but it's unclear to me how all this differs in
the 2.2 branch (e.g., new-style and old-style classes already
took different gc paths in 2.3 before this last round of patches,
but don't in the 2.2 branch).
</content>
</entry>
<entry>
<title>initgc():  Rewrote to use the PyModule_AddXYZ API; cuts code size.</title>
<updated>2003-04-06T23:30:52Z</updated>
<author>
<name>Tim Peters</name>
<email>tim.peters@gmail.com</email>
</author>
<published>2003-04-06T23:30:52Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=1155887a74a5a4062614c4ee5a6f91f2d0198f75'/>
<id>urn:sha1:1155887a74a5a4062614c4ee5a6f91f2d0198f75</id>
<content type='text'>
</content>
</entry>
</feed>
