<feed xmlns='http://www.w3.org/2005/Atom'>
<title>python.git/Include/object.h, branch 2.2</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.</subtitle>
<id>http://dangofactory.net/cgit/cgit.cgi/Server/python.git/atom/Include/object.h?h=2.2</id>
<link rel='self' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/atom/Include/object.h?h=2.2'/>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/'/>
<updated>2001-12-08T18:02:58Z</updated>
<entry>
<title>Patch supplied by Burton Radons for his own SF bug #487390: Modifying</title>
<updated>2001-12-08T18:02:58Z</updated>
<author>
<name>Guido van Rossum</name>
<email>guido@python.org</email>
</author>
<published>2001-12-08T18:02:58Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=146483964e2e94b0d1709be438a1b86f75b5d730'/>
<id>urn:sha1:146483964e2e94b0d1709be438a1b86f75b5d730</id>
<content type='text'>
type.__module__ behavior.

This adds the module name and a dot in front of the type name in every
type object initializer, except for built-in types (and those that
already had this).  Note that it touches lots of Mac modules -- I have
no way to test these but the changes look right.  Apologies if they're
not.  This also touches the weakref docs, which contains a sample type
object initializer.  It also touches the mmap test output, because the
mmap type's repr is included in that output.  It touches object.h to
put the correct description in a comment.
</content>
</entry>
<entry>
<title>SF bug #475327:  type() produces incorrect error msg</title>
<updated>2001-10-27T19:37:48Z</updated>
<author>
<name>Tim Peters</name>
<email>tim.peters@gmail.com</email>
</author>
<published>2001-10-27T19:37:48Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=3abca127fe1565ec80f6b0a1ae48d65186ad887d'/>
<id>urn:sha1:3abca127fe1565ec80f6b0a1ae48d65186ad887d</id>
<content type='text'>
object.h:  Added PyType_CheckExact macro.

typeobject.c, type_new():

+ Use the new macro.
+ Assert that the arguments have the right types rather than do incomplete
  runtime checks "sometimes".
+ If this isn't the 1-argument flavor() of type, and there aren't 3 args
  total, produce a "types() takes 1 or 3 args" msg before
  PyArg_ParseTupleAndKeywords produces a "takes exactly 3" msg.
</content>
</entry>
<entry>
<title>Get rid of __defined__ and tp_defined -- there's no need to</title>
<updated>2001-10-15T22:03:32Z</updated>
<author>
<name>Guido van Rossum</name>
<email>guido@python.org</email>
</author>
<published>2001-10-15T22:03:32Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=687ae00460da9cac04eb1ba8f6f5ab4db25fbfc2'/>
<id>urn:sha1:687ae00460da9cac04eb1ba8f6f5ab4db25fbfc2</id>
<content type='text'>
distinguish __dict__ and __defined__ any more.  In the C structure,
tp_cache takes its place -- but this hasn't been implemented yet.
</content>
</entry>
<entry>
<title>Completely get rid of __dynamic__ and the corresponding</title>
<updated>2001-10-15T21:05:10Z</updated>
<author>
<name>Guido van Rossum</name>
<email>guido@python.org</email>
</author>
<published>2001-10-15T21:05:10Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=2f3ca6eeb6eeebcfa038cd52aca5fecfa74dbd28'/>
<id>urn:sha1:2f3ca6eeb6eeebcfa038cd52aca5fecfa74dbd28</id>
<content type='text'>
Py_TPFLAGS_DYNAMICTYPE bit.  There is no longer a performance benefit,
and I don't really see the use case any more.
</content>
</entry>
<entry>
<title>Keep track of a type's subclasses (subtypes), in tp_subclasses, which</title>
<updated>2001-10-08T15:18:27Z</updated>
<author>
<name>Guido van Rossum</name>
<email>guido@python.org</email>
</author>
<published>2001-10-08T15:18:27Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=1c45073aba8f4097b4dc74d4fd3b2f5ed5e5ea9b'/>
<id>urn:sha1:1c45073aba8f4097b4dc74d4fd3b2f5ed5e5ea9b</id>
<content type='text'>
is a list of weak references to types (new-style classes).  Make this
accessible to Python as the function __subclasses__ which returns a
list of types -- we don't want Python programmers to be able to
manipulate the raw list.

In order to make this possible, I also had to add weak reference
support to type objects.

This will eventually be used together with a trap on attribute
assignment for dynamic classes for a major speed-up without losing the
dynamic properties of types: when a __foo__ method is added to a
class, the class and all its subclasses will get an appropriate tp_foo
slot function.
</content>
</entry>
<entry>
<title>PyObject_ClearWeakRefs() is now a real function instead of a function pointer;</title>
<updated>2001-10-05T21:58:11Z</updated>
<author>
<name>Fred Drake</name>
<email>fdrake@acm.org</email>
</author>
<published>2001-10-05T21:58:11Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=b3f0d349b62e0dbd909fc4012c031b44b4c72916'/>
<id>urn:sha1:b3f0d349b62e0dbd909fc4012c031b44b4c72916</id>
<content type='text'>
the implementation is in Objects/weakrefobject.c.
</content>
</entry>
<entry>
<title>Add Garbage Collection support to new-style classes (not yet to their</title>
<updated>2001-10-02T21:24:57Z</updated>
<author>
<name>Guido van Rossum</name>
<email>guido@python.org</email>
</author>
<published>2001-10-02T21:24:57Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=048eb75c2dca8bf6d483b290c901a53510c9b78a'/>
<id>urn:sha1:048eb75c2dca8bf6d483b290c901a53510c9b78a</id>
<content type='text'>
instances).

Also added GC support to various auxiliary types: super, property,
descriptors, wrappers, dictproxy.  (Only type objects have a tp_clear
field; the other types are.)

One change was necessary to the GC infrastructure.  We have statically
allocated type objects that don't have a GC header (and can't easily
be given one) and heap-allocated type objects that do have a GC
header.  Giving these different metatypes would be really ugly: I
tried, and I had to modify pickle.py, cPickle.c, copy.py, add a new
invent a new name for the new metatype and make it a built-in, change
affected tests...  In short, a mess.  So instead, we add a new type
slot tp_is_gc, which is a simple Boolean function that determines
whether a particular instance has GC headers or not.  This slot is
only relevant for types that have the (new) GC flag bit set.  If the
tp_is_gc slot is NULL (by far the most common case), all instances of
the type are deemed to have GC headers.  This slot is called by the
PyObject_IS_GC() macro (which is only used twice, both times in
gcmodule.c).

I also changed the extern declarations for a bunch of GC-related
functions (_PyObject_GC_Del etc.): these always exist but objimpl.h
only declared them when WITH_CYCLE_GC was defined, but I needed to be
able to reference them without #ifdefs.  (When WITH_CYCLE_GC is not
defined, they do the same as their non-GC counterparts anyway.)
</content>
</entry>
<entry>
<title>Add optional docstrings to getset descriptors.  Fortunately, there's</title>
<updated>2001-09-20T21:45:26Z</updated>
<author>
<name>Guido van Rossum</name>
<email>guido@python.org</email>
</author>
<published>2001-09-20T21:45:26Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=32d34c809f5971f79462dcb7d0f536d46e624acc'/>
<id>urn:sha1:32d34c809f5971f79462dcb7d0f536d46e624acc</id>
<content type='text'>
no backwards compatibility to worry about, so I just pushed the
'closure' struct member to the back -- it's never used in the current
code base (I may eliminate it, but that's more work because the getter
and setter signatures would have to change.)

As examples, I added actual docstrings to the getset attributes of a
few types: file.closed, xxsubtype.spamdict.state.
</content>
</entry>
<entry>
<title>Add optional docstrings to member descriptors.  For backwards</title>
<updated>2001-09-20T20:46:19Z</updated>
<author>
<name>Guido van Rossum</name>
<email>guido@python.org</email>
</author>
<published>2001-09-20T20:46:19Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=6f7993765ac0989b5d13084240797913627a31d8'/>
<id>urn:sha1:6f7993765ac0989b5d13084240797913627a31d8</id>
<content type='text'>
compatibility, this required all places where an array of "struct
memberlist" structures was declared that is referenced from a type's
tp_members slot to change the type of the structure to PyMemberDef;
"struct memberlist" is now only used by old code that still calls
PyMember_Get/Set.  The code in PyObject_GenericGetAttr/SetAttr now
calls the new APIs PyMember_GetOne/SetOne, which take a PyMemberDef
argument.

As examples, I added actual docstrings to the attributes of a few
types: file, complex, instance method, super, and xxsubtype.spamlist.

Also converted the symtable to new style getattr.
</content>
</entry>
<entry>
<title>Hopefully fix 3-way comparisons.  This unfortunately adds yet another</title>
<updated>2001-09-18T20:38:53Z</updated>
<author>
<name>Guido van Rossum</name>
<email>guido@python.org</email>
</author>
<published>2001-09-18T20:38:53Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=ab3b0343b89b4683148dadaf89728ee1198ebee5'/>
<id>urn:sha1:ab3b0343b89b4683148dadaf89728ee1198ebee5</id>
<content type='text'>
hack, and it's even more disgusting than a PyInstance_Check() call.
If the tp_compare slot is the slot used for overrides in Python,
it's always called.

Add some tests that show what should work too.
</content>
</entry>
</feed>
