History log of /external/python/cpython2/Objects/typeobject.c
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
4403d501ac0365c0ea7cd948fcba344ab014a878 14-Dec-2016 Benjamin Peterson <benjamin@python.org> revert a37cc3d926ec (#5322)
/external/python/cpython2/Objects/typeobject.c
d1aad3fceb3d69c9b9bceb9899fc2d57ff462844 14-Dec-2016 Benjamin Peterson <benjamin@python.org> Backed out changeset ea904d4b3634
/external/python/cpython2/Objects/typeobject.c
f8f2138bd4c715f249f397c8f56cf75dec080931 03-Dec-2016 Benjamin Peterson <benjamin@python.org> fix refleak in reduce_2 error case
/external/python/cpython2/Objects/typeobject.c
cffc0f41782ca8c182af1e066d5146bdb18e6406 02-Dec-2016 Benjamin Peterson <benjamin@python.org> declarations to the top of the block
/external/python/cpython2/Objects/typeobject.c
daf82f7539218eb03385b51bffaceb6970fc76d8 02-Dec-2016 Serhiy Storchaka <storchaka@gmail.com> Issue #5322: Fixed setting __new__ to a PyCFunction inside Python code.
Original patch by Andreas Stührk.
/external/python/cpython2/Objects/typeobject.c
61dd7ff0735936b77071a90151faccb9eb8ca16d 07-Oct-2016 Serhiy Storchaka <storchaka@gmail.com> Issue #26906: Resolving special methods of uninitialized type now causes
implicit initialization of the type instead of a fail.
/external/python/cpython2/Objects/typeobject.c
0ea51b18d547e555ffa99df60341431b6b85c0a9 07-Oct-2016 Serhiy Storchaka <storchaka@gmail.com> Issue #18287: PyType_Ready() now checks that tp_name is not NULL.
Original patch by Niklas Koep.
/external/python/cpython2/Objects/typeobject.c
42e9d94bc5d7134461a03afe9526e0926ed223dc 19-Aug-2016 Victor Stinner <victor.stinner@gmail.com> Fix a refleak in call_maybe()

Issue #27128. Fix a reference leak if creating the tuple to pass positional
parameters fails.
/external/python/cpython2/Objects/typeobject.c
c9921d3bdc6717ba221b1338d4d7e2323d5f0bb5 19-Aug-2016 Victor Stinner <victor.stinner@gmail.com> Fix a refleak in call_method()

Issue #27128. Fix a reference leak if creating the tuple to pass positional
parameters fails.
/external/python/cpython2/Objects/typeobject.c
3d36f0f712e8a720e66808e2b634aace11c6bb88 28-Jul-2016 Martin Panter <vadmium+py@gmail.com> Spelling and grammar fixes in code comments and documentation
/external/python/cpython2/Objects/typeobject.c
ee69451f344847858919bacf00a087c77f381264 07-Jul-2016 Benjamin Peterson <benjamin@python.org> fix refleaks in PyDict_SetItem error cases (closes #27248)
/external/python/cpython2/Objects/typeobject.c
646b528467b171148143980452d2aa4294cbe5c8 22-Jun-2016 Martin Panter <vadmium+py@gmail.com> Issue #22463: Backport compiler warning fixes and workarounds

* Set but unused variable in Parser/pgen.c in non-debug builds. Patch by
Christian Heimes.
* Unused static function in Modules/readline.c. Patch by Georg Brandl.
* main_window unused in Modules/tkappinit.c. Patch by Gregory P. Smith.
* Dead assignment in Modules/_ctypes/cfield.c. Extracted from patch by Brett
Cannon.
* Expression result unused in PyObject_INIT macro expansions. Based on
patches by Christian Heimes.
* Load expat_config.h and therefore pyconfig.h before C stdlib headers are
loaded. This silences pre-processor warnings including '_POSIX_C_SOURCE
redefined'. Extracted from patch by Christian Heimes.
/external/python/cpython2/Objects/typeobject.c
1a9ee946b0bd9eb93e48833e0f4de6b338867673 05-Jun-2016 Serhiy Storchaka <storchaka@gmail.com> Issue #27225: Fixed a reference leak in type_new when setting __new__ fails.
Original patch by Xiang Zhang.
/external/python/cpython2/Objects/typeobject.c
6ee36a5a8cf7aff3a2b5f3ab50bb46a31c377750 28-May-2016 Benjamin Peterson <benjamin@python.org> Backed out changeset e7062dd9085e (#25731)
/external/python/cpython2/Objects/typeobject.c
9ec6464008c3a04e6486541c4f031bdf0af28cf3 13-Apr-2016 Serhiy Storchaka <storchaka@gmail.com> Issue #26718: super.__init__ no longer leaks memory if called multiple times.
NOTE: A direct call of super.__init__ is not endorsed!
/external/python/cpython2/Objects/typeobject.c
bc62af1bbe118aa678cb6fa4ecad40f7250b56de 06-Apr-2016 Serhiy Storchaka <storchaka@gmail.com> Issue #22570: Renamed Py_SETREF to Py_XSETREF.
/external/python/cpython2/Objects/typeobject.c
b59b04dd86514cec9e7acd6b2c65e49afaaa3b2a 07-Feb-2016 Benjamin Peterson <benjamin@python.org> fix hash member name (closes #22847)
/external/python/cpython2/Objects/typeobject.c
4a0a9556fced91be576abd2658fd32a4d2687563 05-Feb-2016 Benjamin Peterson <benjamin@python.org> fix debug assertion
/external/python/cpython2/Objects/typeobject.c
225e7c0defec9ee88f5ce7a318d659cfbc7028ea 15-Nov-2014 Antoine Pitrou <solipsis@pitrou.net> Issue #22847: Improve method cache efficiency.
/external/python/cpython2/Objects/typeobject.c
a4acf1ff847f072b2035bbb02c9af5496e59d6d6 19-Jan-2016 Benjamin Peterson <benjamin@python.org> set tp_new from the class in the hierarchy that actually owns the descriptor (closes #25731)

Debugging by Eryk Sun.
/external/python/cpython2/Objects/typeobject.c
607965eb7e11b9405e23175d1f8aee3647425a80 11-Jan-2016 Barry Warsaw <barry@python.org> Comment out two tests that won't pass now after reverting the typeobject.c
change. Also, as per further discussion, we'll just remove the regressing
code in typeobject.c
/external/python/cpython2/Objects/typeobject.c
f65395c8c27170e3ce7b161ec43cf9947bb7f5fe 11-Jan-2016 Barry Warsaw <barry@python.org> Issue #22995: [UPDATE] Comment out the one of the pickleability tests in
_PyObject_GetState() due to regressions observed in Cython-based projects.
/external/python/cpython2/Objects/typeobject.c
28f35f246b1bc030bd3f2ed0ca1010412dee2273 30-Dec-2015 Serhiy Storchaka <storchaka@gmail.com> Issue #25961: Fixed compilation error and a leak in type constructor.
/external/python/cpython2/Objects/typeobject.c
f9347e3b44425c1cb357a0ae76e8756c5894d6c6 30-Dec-2015 Serhiy Storchaka <storchaka@gmail.com> Issue #25961: Disallowed null characters in the type name.
/external/python/cpython2/Objects/typeobject.c
b8e54dd806e75f3591d8b7f07676a5738dad019d 30-Dec-2015 Serhiy Storchaka <storchaka@gmail.com> Issue #22995: Instances of extension types with a state that aren't
subclasses of list or dict and haven't implemented any pickle-related
methods (__reduce__, __reduce_ex__, __getnewargs__, __getnewargs_ex__,
or __getstate__), can no longer be pickled. Including memoryview.
/external/python/cpython2/Objects/typeobject.c
5951f2300f43d75d344d542e171daed47a0382a6 24-Dec-2015 Serhiy Storchaka <storchaka@gmail.com> Issue #20440: Massive replacing unsafe attribute setting code with special
macro Py_SETREF.
/external/python/cpython2/Objects/typeobject.c
ee1b24ccaaab4efd583f30a27957ed9fdf374e2e 25-Nov-2015 Serhiy Storchaka <storchaka@gmail.com> Issue #24097: Fixed crash in object.__reduce__() if slot name is freed inside
__getattr__. Original patch by Antoine Pitrou.
/external/python/cpython2/Objects/typeobject.c
fedcf9474e73a8cb209a61f513f46fb062f2cd11 12-Nov-2015 Serhiy Storchaka <storchaka@gmail.com> Issue #22995: Default implementation of __reduce__ and __reduce_ex__ now
rejects builtin types with not defined __new__.
/external/python/cpython2/Objects/typeobject.c
77d12ecaade4ef1b0719412cd85aeba81e3d4563 07-Oct-2015 Benjamin Peterson <benjamin@python.org> prevent unacceptable bases from becoming bases through multiple inheritance (#24806)
/external/python/cpython2/Objects/typeobject.c
f0aa88f6e856710c4cf5bdb23a81817a841c4553 10-Jun-2015 Serhiy Storchaka <storchaka@gmail.com> Fixed indentation of Python examples in C comments.
/external/python/cpython2/Objects/typeobject.c
ce16424b0bb430568c95691cb0439d28152e58bf 22-Mar-2015 Serhiy Storchaka <storchaka@gmail.com> Issue #22079: Py3k warning now is issued in PyType_Ready() instead of
raising TypeError when statically allocated type subclasses dynamically
allocated type
/external/python/cpython2/Objects/typeobject.c
323ab6d732075da2011159e037b9a304e567ae64 10-Mar-2015 Antoine Pitrou <solipsis@pitrou.net> Issue #23629: Fix the default __sizeof__ implementation for variable-sized objects.
/external/python/cpython2/Objects/typeobject.c
4c54387f11d8c38d3bf59f547ab72b78354ad5de 28-Jan-2015 Serhiy Storchaka <storchaka@gmail.com> Issue #22079: PyType_Ready() now checks that statically allocated type has
no dynamically allocated bases.
/external/python/cpython2/Objects/typeobject.c
e2defc4132fd0254b8c437c946dd6b311d4664c3 27-Nov-2014 Benjamin Peterson <benjamin@python.org> remove tautological condition (closes #22954)
/external/python/cpython2/Objects/typeobject.c
409062c669e4d3163b494a73d119aede66700f41 31-Oct-2014 Georg Brandl <georg@python.org> Closes #22772: fix __ifloordiv__ and __itruediv__ docstring.
/external/python/cpython2/Objects/typeobject.c
f794b143d32c30f4a910ff19bded3e62c20313e1 13-Apr-2013 Mark Dickinson <dickinsm@gmail.com> Issue #16447: Fix potential segfault when setting __name__ on a class.
/external/python/cpython2/Objects/typeobject.c
74001fad7d15f96f5c01b4b42fab16a4d5791ff9 07-Apr-2013 Benjamin Peterson <benjamin@python.org> list slotdefs in offset order rather than sorting them (closes #17610)

This means we can remove our usage of qsort() than relied on undefined behavior.

Backport by Zbigniew Halas.
/external/python/cpython2/Objects/typeobject.c
5aff27aec18e08365891c4bc1d81cca87d9d49fd 19-Feb-2013 R David Murray <rdmurray@bitdance.com> #7963: fix error message when 'object' called with arguments.

Patch by Alexander Belopolsky.
/external/python/cpython2/Objects/typeobject.c
ac7b49f4076a4336915d13a4aa19feaeadd29d62 19-Jan-2013 Raymond Hettinger <python@rcn.com> Improve tooltips by listing the most common argument pattern first.
/external/python/cpython2/Objects/typeobject.c
47770ed914606282b5e251d03a17b90795ec347a 10-Sep-2012 Christian Heimes <christian@cheimes.de> Fixed memory leak in error branch of object_repr which may leak a reference to mod when type_name returns NULL. CID 715371
/external/python/cpython2/Objects/typeobject.c
4e80eea60e439d6fb0a12bb803ca52061f29f7d6 10-Sep-2012 Christian Heimes <christian@cheimes.de> Fixed possible reference leak to mod when type_name() returns NULL
/external/python/cpython2/Objects/typeobject.c
58098a77e62ec3ae40180eb36672d44a337121db 06-Sep-2012 Antoine Pitrou <solipsis@pitrou.net> Issue #13992: The trashcan mechanism is now thread-safe. This eliminates
sporadic crashes in multi-thread programs when several long deallocator
chains ran concurrently and involved subclasses of built-in container
types.

Because of this change, a couple extension modules compiled for 2.7.4
(those which use the trashcan mechanism, despite it being undocumented)
will not be loadable by 2.7.3 and earlier. However, extension modules
compiled for 2.7.3 and earlier will be loadable by 2.7.4.
/external/python/cpython2/Objects/typeobject.c
c5bef75c77af414c2f6c5901b6838d3071313bc7 15-Aug-2012 Antoine Pitrou <solipsis@pitrou.net> Issue #15604: Update uses of PyObject_IsTrue() to check for and handle errors correctly.
Patch by Serhiy Storchaka.
/external/python/cpython2/Objects/typeobject.c
f1ae5cf5c7f17e1103735060457fccd5844d21c9 08-May-2012 Benjamin Peterson <benjamin@python.org> fix possible refleak (closes #14752)
/external/python/cpython2/Objects/typeobject.c
d157a4c3dd49728b95fe63b2ff931da5bec5fe75 24-Apr-2012 Benjamin Peterson <benjamin@python.org> don't use a slot wrapper from a different special method (closes #14658)

This also alters the fix to #11603. Specifically, setting __repr__ to
object.__str__ now raises a recursion RuntimeError when str() or repr() is
called instead of silently bypassing the recursion. I believe this behavior is
more correct.
/external/python/cpython2/Objects/typeobject.c
6e7832b04caf33196a56c153821631d33bbb3bff 16-Mar-2012 Benjamin Peterson <benjamin@python.org> check to make sure the attribute is a string (#14334)
/external/python/cpython2/Objects/typeobject.c
a8d458560e961bd45c5a8900f964cb9c7d95e475 08-Mar-2012 Benjamin Peterson <benjamin@python.org> allow cycles throught the __dict__ slot to be cleared (closes #1469629)

Patch from Armin, test from me.
/external/python/cpython2/Objects/typeobject.c
5b4b2da55dbc2a439235e8e969309c143320f4fc 15-Dec-2011 Antoine Pitrou <solipsis@pitrou.net> Fix the fix for issue #12149: it was incorrect, although it had the side
effect of appearing to resolve the issue. Thanks to Mark Shannon for
noticing.
/external/python/cpython2/Objects/typeobject.c
d78418530373a3929770a971276e6689e283899f 11-Nov-2011 Eli Bendersky <eliben@gmail.com> Issue #13161: fix doc strings of __i*__ operators
/external/python/cpython2/Objects/typeobject.c
de66ecc75fc06abbee21100e760cc7a5542c0308 17-Aug-2011 Benjamin Peterson <benjamin@python.org> fix possible refleaks
/external/python/cpython2/Objects/typeobject.c
304f0f952da3c2f1d354b1701aa5ad61b53ff179 15-Jul-2011 Antoine Pitrou <solipsis@pitrou.net> Issue #11603: Fix a crash when __str__ is rebound as __repr__.
Patch by Andreas Stührk.
/external/python/cpython2/Objects/typeobject.c
1616645a0032b45c935ec6bdbb1d46b3febf0827 12-Jul-2011 Antoine Pitrou <solipsis@pitrou.net> Issue #12149: Update the method cache after a type's dictionnary gets
cleared by the garbage collector. This fixes a segfault when an instance
and its type get caught in a reference cycle, and the instance's
deallocator calls one of the methods on the type (e.g. when subclassing
IOBase).

Diagnosis and patch by Davide Rizzo.
/external/python/cpython2/Objects/typeobject.c
80a09c70bfa4592a8067274f49f24f9fffe8b795 24-May-2011 Benjamin Peterson <benjamin@python.org> use '->' to indicate return values
/external/python/cpython2/Objects/typeobject.c
c2077b0d9b5bf99768c6f396bf7ae6c41b682465 15-Mar-2011 Ezio Melotti <ezio.melotti@gmail.com> #11565: Fix several typos. Patch by Piotr Kasprzyk.
/external/python/cpython2/Objects/typeobject.c
fba33478a5af3da448ca363626ab451ffc1aef6c 17-Jan-2011 Benjamin Peterson <benjamin@python.org> Merged revisions 88069 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k

........
r88069 | benjamin.peterson | 2011-01-17 13:54:55 -0600 (Mon, 17 Jan 2011) | 1 line

remove unneeded assertion
........
/external/python/cpython2/Objects/typeobject.c
cd8500193f93da975feb470865e349d529d55985 17-Jan-2011 Benjamin Peterson <benjamin@python.org> Merged revisions 88066 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k

........
r88066 | benjamin.peterson | 2011-01-17 13:44:46 -0600 (Mon, 17 Jan 2011) | 1 line

correct assertion
........
/external/python/cpython2/Objects/typeobject.c
cf94b8b4da11245baec45a27153804c9f70382f0 17-Jan-2011 Benjamin Peterson <benjamin@python.org> Merged revisions 88063 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k

........
r88063 | benjamin.peterson | 2011-01-17 13:24:34 -0600 (Mon, 17 Jan 2011) | 4 lines

turn some checks into assertions, since they are implied by the caller

Reviewed by Georg.
........
/external/python/cpython2/Objects/typeobject.c
f4676b0378a46f739857d123692b1698d50aadaa 12-Jan-2011 Benjamin Peterson <benjamin@python.org> Merged revisions 87960 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k

........
r87960 | benjamin.peterson | 2011-01-12 12:56:07 -0600 (Wed, 12 Jan 2011) | 1 line

use PyErr_SetString instead of PyErr_Format
........
/external/python/cpython2/Objects/typeobject.c
9b911ca14d4897e517276cb9729ecc6ad6c178db 12-Jan-2011 Benjamin Peterson <benjamin@python.org> Merged revisions 87952-87954 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k

........
r87952 | benjamin.peterson | 2011-01-12 09:24:27 -0600 (Wed, 12 Jan 2011) | 1 line

move this test to test_descr; it's not abc specific
........
r87953 | benjamin.peterson | 2011-01-12 09:25:02 -0600 (Wed, 12 Jan 2011) | 1 line

oops, wrong class
........
r87954 | benjamin.peterson | 2011-01-12 09:34:01 -0600 (Wed, 12 Jan 2011) | 1 line

don't segfault on deleting __abstractmethods__ #10892
........
/external/python/cpython2/Objects/typeobject.c
35c6be0b744f3e9fab99bbbe590498612507928a 03-Oct-2010 Benjamin Peterson <benjamin@python.org> Merged revisions 85193 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k

........
r85193 | benjamin.peterson | 2010-10-02 21:13:39 -0500 (Sat, 02 Oct 2010) | 1 line

typo
........
/external/python/cpython2/Objects/typeobject.c
a5d5cc45c9a8991a74f111e9d4846a0c043d7674 02-Oct-2010 Benjamin Peterson <benjamin@python.org> Merged revisions 85154 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k

........
r85154 | benjamin.peterson | 2010-10-01 19:03:31 -0500 (Fri, 01 Oct 2010) | 1 line

type.__abstractmethods__ should raise an AttributeError #10006
........
/external/python/cpython2/Objects/typeobject.c
6f3d6a9b2369dd68970bd47e85b27ee624580aaa 26-Aug-2010 Benjamin Peterson <benjamin@python.org> Merged revisions 84320 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k

........
r84320 | benjamin.peterson | 2010-08-25 18:13:17 -0500 (Wed, 25 Aug 2010) | 1 line

basicsize and itemsize are Py_ssize_t #9688
........
/external/python/cpython2/Objects/typeobject.c
b8de9fab302263b6950b1d1e978b253e73682e06 16-Aug-2010 Alexander Belopolsky <alexander.belopolsky@gmail.com> Merged revisions 84106 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k

........
r84106 | alexander.belopolsky | 2010-08-16 16:17:07 -0400 (Mon, 16 Aug 2010) | 1 line

Issue #8983: Corrected docstrings.
........
/external/python/cpython2/Objects/typeobject.c
77acee95677152af7417ad47148cf24feb4c947c 05-Jun-2010 Mark Dickinson <dickinsm@gmail.com> Fix comment typo.
/external/python/cpython2/Objects/typeobject.c
e4b83e013ba8c2bda78163da38783f79b1a86079 05-Jun-2010 Mark Dickinson <dickinsm@gmail.com> Issue #8627: Fix "XXX undetected error" from unchecked PyErr_WarnPy3k return.
This is just a quick fix: if the warning is turned into an exception, the
exception simply gets ignored.
/external/python/cpython2/Objects/typeobject.c
23f0d6b57bb9427df0ab2305c47f14b9c092e0fe 05-Jun-2010 Mark Dickinson <dickinsm@gmail.com> Issue #8627: remove out-of-date warning about overriding __cmp__
/external/python/cpython2/Objects/typeobject.c
67783b1f71aca25573b736121ff32098c7cbf4f8 05-Jun-2010 Benjamin Peterson <benjamin@python.org> fix ref counting
/external/python/cpython2/Objects/typeobject.c
039c585805f50411f868dd315f1315ca7ccc9573 05-Jun-2010 Benjamin Peterson <benjamin@python.org> implement object.__format__ with PyObject_Format
/external/python/cpython2/Objects/typeobject.c
c83ea137d7e717f764e2f31fc2544f522de7d857 09-May-2010 Antoine Pitrou <solipsis@pitrou.net> Untabify C files. Will watch buildbots.
/external/python/cpython2/Objects/typeobject.c
8a478ced5585c7819668d028f6969b043a86fc58 05-May-2010 Brett Cannon <bcannon@gmail.com> Remove an unneeded assignment.

Found using Clang's static analyzer.
/external/python/cpython2/Objects/typeobject.c
d44b2fc87c2d9bd9e390eb54d50306959d80ba87 02-Apr-2010 Eric Smith <eric@trueblade.com> Issue 7994: Make object.__format__ with a non-empty format string a PendingDecprecationWarning. Still need to remove uses of this from various tests.
/external/python/cpython2/Objects/typeobject.c
0c0dcaf2724069804545a738f4a6431f05a6c23d 16-Dec-2009 Benjamin Peterson <benjamin@python.org> remove type_compare, since type_richcompare does the same trick
/external/python/cpython2/Objects/typeobject.c
4895af4ef1c91679e642c0fc81f584aecc26a7ea 13-Dec-2009 Benjamin Peterson <benjamin@python.org> fix the ignoring of __cmp__ method on metaclasses #7491
/external/python/cpython2/Objects/typeobject.c
fb6fb062e8f677dd63943f3a4b8a45c6665b3418 16-May-2009 Benjamin Peterson <benjamin@python.org> properly lookup __instancecheck__ and __subclasscheck__
/external/python/cpython2/Objects/typeobject.c
0a32f9c448a7d0fb29f2e6f4df26a2019498c45e 09-May-2009 Benjamin Peterson <benjamin@python.org> can't handle classic classes here
/external/python/cpython2/Objects/typeobject.c
399e4c4f8f2570a342ac50e9500b12e86eb330a9 08-May-2009 Benjamin Peterson <benjamin@python.org> add _PyObject_LookupSpecial to handle fetching special method lookup
/external/python/cpython2/Objects/typeobject.c
5083dc552b4e7026c2f405b37d7691131bc96955 25-Apr-2009 Benjamin Peterson <benjamin@python.org> fix a segfault when setting __class__ in __del__ #5283
/external/python/cpython2/Objects/typeobject.c
789be0c0a0656d17f831aa781cf7c5d55e5b4835 02-Apr-2009 Antoine Pitrou <solipsis@pitrou.net> Issue #2396: backport the memoryview object.
/external/python/cpython2/Objects/typeobject.c
ed4cefbedd1817247b94e5880f850bc1c3f6628d 15-Mar-2009 Georg Brandl <georg@python.org> Fix a small nit in the error message if bool() falls back on __len__ and it returns the wrong type: it would tell the user that __nonzero__ should return bool or int.
/external/python/cpython2/Objects/typeobject.c
78821ddf8c8eeebf757d72c2989cc0accea155de 25-Jan-2009 Benjamin Peterson <benjamin@python.org> fix building the core with --disable-unicode

I changed some bytearray methods to use strings instead of unicode like bytes_repr
Also, bytearray.fromhex() can take strings as well as unicode
/external/python/cpython2/Objects/typeobject.c
bd55c52565d171ceb78d8f3b0f8b6cc6253e8e68 17-Jan-2009 Amaury Forgeot d'Arc <amauryfa@gmail.com> #4930: Slightly cleaner (and faster) code in type creation:
compare slots by address, not by name.
/external/python/cpython2/Objects/typeobject.c
a40d57366432cd65915b92fe3e6bfe1d5ad63be0 13-Jan-2009 Amaury Forgeot d'Arc <amauryfa@gmail.com> #3720: Interpreter crashes when an evil iterator removes its own next function.

Now the slot is filled with a function that always raises.

Will not backport: extensions compiled with 2.6.x would not run on 2.6.0.
/external/python/cpython2/Objects/typeobject.c
273c233c78d36f65059342981dcdc5b212a7e558 17-Nov-2008 Benjamin Peterson <benjamin@python.org> when __getattr__ is a descriptor, call it correctly; fixes #4230

patch from Ziga Seilnacht
/external/python/cpython2/Objects/typeobject.c
0668c62677e76b2acf7e4d11d5e9c1f4420a54f1 27-Aug-2008 Antoine Pitrou <solipsis@pitrou.net> Issue #2534: speed up isinstance() and issubclass() by 50-70%, so as to
match Python 2.5 speed despite the __instancecheck__ / __subclasscheck__
mechanism. In the process, fix a bug where isinstance() and issubclass(),
when given a tuple of classes as second argument, were looking up
__instancecheck__ / __subclasscheck__ on the tuple rather than on each
type object.

Reviewed by Benjamin Peterson and Raymond Hettinger.
/external/python/cpython2/Objects/typeobject.c
712ee923092ef1b47c72914c5e2950be2f05f527 24-Aug-2008 Benjamin Peterson <benjamin@python.org> generate py3k warnings on __getslice__, __delslice__, and __setslice__

Reviewer: Brett Cannon
/external/python/cpython2/Objects/typeobject.c
48361f5cbf419cce361fd1aa0389d6304ad167db 11-Aug-2008 Nick Coghlan <ncoghlan@gmail.com> Issue 2235: Py3k warnings are now emitted for classes that will no longer inherit a__hash__ implementation from a parent class in Python 3.x. The standard library and test suite have been updated to not emit these warnings.
/external/python/cpython2/Objects/typeobject.c
53663a695ef2bb96ac0252cd4cc4aa40d4f953be 15-Jul-2008 Nick Coghlan <ncoghlan@gmail.com> Issue 2235: __hash__ is once again inherited by default, but inheritance can be blocked explicitly so that collections.Hashable remains meaningful
/external/python/cpython2/Objects/typeobject.c
9c437af4ebd832d913b85bfb2e666d55565c3665 25-Jun-2008 Raymond Hettinger <python@rcn.com> Revert 64424, 64438, and 64439.
/external/python/cpython2/Objects/typeobject.c
e3ae655edfea3dd8ed32fcca63cb3eae861a58b7 20-Jun-2008 Raymond Hettinger <python@rcn.com> Make bin() implementation parallel oct() and hex() so that int/long subclasses can override or so that other classes can support.
/external/python/cpython2/Objects/typeobject.c
dd96db63f689e2f0d8ae5a1436b3b3395eec7de5 09-Jun-2008 Gregory P. Smith <greg@mad-scientist.com> This reverts r63675 based on the discussion in this thread:

http://mail.python.org/pipermail/python-dev/2008-June/079988.html

Python 2.6 should stick with PyString_* in its codebase. The PyBytes_* names
in the spirit of 3.0 are available via a #define only. See the email thread.
/external/python/cpython2/Objects/typeobject.c
7a6de8b0f465037ed75104d8f17ca3de99a4da52 01-Jun-2008 Georg Brandl <georg@python.org> Some style nits. Also clarify in the docstrings what __sizeof__ does.
/external/python/cpython2/Objects/typeobject.c
51df0647672bc758da6d58eecfe45da9dc5913df 01-Jun-2008 Robert Schuppenies <okkotonushi@googlemail.com> Issue #2898: Added sys.getsizeof() to retrieve size of objects in bytes.
/external/python/cpython2/Objects/typeobject.c
f18a70720542268586e271bbadab3fb0332b8a39 29-May-2008 Georg Brandl <georg@python.org> Revert #2990 patch; it's not necessary as Armin showed.
/external/python/cpython2/Objects/typeobject.c
5ec330cb2f1b041ebba6dedb6a02cd27a7e9f3da 28-May-2008 Georg Brandl <georg@python.org> #2990: prevent inconsistent state while updating method cache.
/external/python/cpython2/Objects/typeobject.c
74a1deaab360e118fa5f4621fd30a4ef4cc5a53e 28-May-2008 Georg Brandl <georg@python.org> #2989: add PyType_Modified().
/external/python/cpython2/Objects/typeobject.c
593daf545bd9b7e7bcb27b498ecc6f36db9ae395 26-May-2008 Christian Heimes <christian@cheimes.de> Renamed PyString to PyBytes
/external/python/cpython2/Objects/typeobject.c
dffbf5f5421cbeb20237280c0bd70f989269f844 20-May-2008 Georg Brandl <georg@python.org> Revert copy_reg -> copyreg rename.
/external/python/cpython2/Objects/typeobject.c
ea0b22a167f25deaf170da2c321fbd9d64af1ab3 16-May-2008 Alexandre Vassalotti <alexandre@peadrop.com> Patch by Quentin Gallet-Gilles: Renaming leftovers for 2.6.

This fixes the omissions of configparser, copyreg, queue and
socketserver renaming.
/external/python/cpython2/Objects/typeobject.c
9510e4a9f8503421c9f589e99e697aa5f3b89b69 11-May-2008 Alexandre Vassalotti <alexandre@peadrop.com> Added module stub for copy_reg renaming in 3.0.
Renamed copy_reg to copyreg in the standard library, to avoid
spurious warnings and ease later merging to py3k branch. Public
documentation remains intact.
/external/python/cpython2/Objects/typeobject.c
9f4f48114fbf2df3803a44a30cd14e11679403fe 27-Apr-2008 Benjamin Peterson <benjamin@python.org> Use PyErr_WarnPy3k throughout
/external/python/cpython2/Objects/typeobject.c
1a6387e68300b6f554f4f4f044491b7034733442 26-Mar-2008 Christian Heimes <christian@cheimes.de> Merged revisions 61750,61752,61754,61756,61760,61763,61768,61772,61775,61805,61809,61812,61819,61917,61920,61930,61933-61934 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/trunk-bytearray

........
r61750 | christian.heimes | 2008-03-22 20:47:44 +0100 (Sat, 22 Mar 2008) | 1 line

Copied files from py3k w/o modifications
........
r61752 | christian.heimes | 2008-03-22 20:53:20 +0100 (Sat, 22 Mar 2008) | 7 lines

Take One
* Added initialization code, warnings, flags etc. to the appropriate places
* Added new buffer interface to string type
* Modified tests
* Modified Makefile.pre.in to compile the new files
* Added bytesobject.c to Python.h
........
r61754 | christian.heimes | 2008-03-22 21:22:19 +0100 (Sat, 22 Mar 2008) | 2 lines

Disabled bytearray.extend for now since it causes an infinite recursion
Fixed serveral unit tests
........
r61756 | christian.heimes | 2008-03-22 21:43:38 +0100 (Sat, 22 Mar 2008) | 5 lines

Added PyBytes support to several places:
str + bytearray
ord(bytearray)
bytearray(str, encoding)
........
r61760 | christian.heimes | 2008-03-22 21:56:32 +0100 (Sat, 22 Mar 2008) | 1 line

Fixed more unit tests related to type('') is not unicode
........
r61763 | christian.heimes | 2008-03-22 22:20:28 +0100 (Sat, 22 Mar 2008) | 2 lines

Fixed more unit tests
Fixed bytearray.extend
........
r61768 | christian.heimes | 2008-03-22 22:40:50 +0100 (Sat, 22 Mar 2008) | 1 line

Implemented old buffer interface for bytearray
........
r61772 | christian.heimes | 2008-03-22 23:24:52 +0100 (Sat, 22 Mar 2008) | 1 line

Added backport of the io module
........
r61775 | christian.heimes | 2008-03-23 03:50:49 +0100 (Sun, 23 Mar 2008) | 1 line

Fix str assignement to bytearray. Assignment of a str of size 1 is interpreted as a single byte
........
r61805 | christian.heimes | 2008-03-23 19:33:48 +0100 (Sun, 23 Mar 2008) | 3 lines

Fixed more tests
Fixed bytearray() comparsion with unicode()
Fixed iterator assignment of bytearray
........
r61809 | christian.heimes | 2008-03-23 21:02:21 +0100 (Sun, 23 Mar 2008) | 2 lines

str(bytesarray()) now returns the bytes and not the representation of the bytearray object
Enabled and fixed more unit tests
........
r61812 | christian.heimes | 2008-03-23 21:53:08 +0100 (Sun, 23 Mar 2008) | 3 lines

Clear error PyNumber_AsSsize_t() fails
Use CHARMASK for ob_svall access
disabled a test with memoryview again
........
r61819 | christian.heimes | 2008-03-23 23:05:57 +0100 (Sun, 23 Mar 2008) | 1 line

Untested updates to the PCBuild directory
........
r61917 | christian.heimes | 2008-03-26 00:57:06 +0100 (Wed, 26 Mar 2008) | 1 line

The type system of Python 2.6 has subtle differences to 3.0's. I've removed the Py_TPFLAGS_BASETYPE flags from bytearray for now. bytearray can't be subclasses until the issues with bytearray subclasses are fixed.
........
r61920 | christian.heimes | 2008-03-26 01:44:08 +0100 (Wed, 26 Mar 2008) | 2 lines

Disabled last failing test
I don't understand what the test is testing and how it suppose to work. Ka-Ping, please check it out.
........
r61930 | christian.heimes | 2008-03-26 12:46:18 +0100 (Wed, 26 Mar 2008) | 1 line

Re-enabled bytes warning code
........
r61933 | christian.heimes | 2008-03-26 13:20:46 +0100 (Wed, 26 Mar 2008) | 1 line

Fixed a bug in the new buffer protocol. The buffer slots weren't copied into a subclass.
........
r61934 | christian.heimes | 2008-03-26 13:25:09 +0100 (Wed, 26 Mar 2008) | 1 line

Re-enabled bytearray subclassing - all tests are passing.
........
/external/python/cpython2/Objects/typeobject.c
d5b635f1969fdd609f0aff5669c9ec30e61be62e 25-Mar-2008 Georg Brandl <georg@python.org> Make Py3k warnings consistent w.r.t. punctuation; also respect the
EOL 80 limit and supply more alternatives in warning messages.
/external/python/cpython2/Objects/typeobject.c
ae42f33cdfb68be2fc71be0fb67ec025f90160e8 18-Mar-2008 Steven Bethard <steven.bethard@gmail.com> Add py3k warnings for object, type, cell and dict comparisons. This should resolve issue2342 and partly resolve issue2373.
/external/python/cpython2/Objects/typeobject.c
960b9b7a2f6e9b4f0e6b692d604c53b3fd2f5d1c 28-Feb-2008 Jeffrey Yasskin <jyasskin@gmail.com> Move abc._Abstract into object by adding a new flag Py_TPFLAGS_IS_ABSTRACT,
which forbids constructing types that have it set. The effect is to speed

./python.exe -m timeit -s 'import abc' -s 'class Foo(object): __metaclass__ = abc.ABCMeta' 'Foo()'

up from 2.5us to 0.201us. This fixes issue 1762.
/external/python/cpython2/Objects/typeobject.c
a9f7d6248032c9572b4d2024a1be8bd2823af09f 17-Feb-2008 Eric Smith <eric@trueblade.com> Backport of PEP 3101, Advanced String Formatting, from py3k.

Highlights:
- Adding PyObject_Format.
- Adding string.Format class.
- Adding __format__ for str, unicode, int, long, float, datetime.
- Adding builtin format.
- Adding ''.format and u''.format.
- str/unicode fixups for formatters.

The files in Objects/stringlib that implement PEP 3101 (stringdefs.h,
unicodedefs.h, formatter.h, string_format.h) are identical in trunk
and py3k. Any changes from here on should be made to trunk, and
changes will propogate to py3k).
/external/python/cpython2/Objects/typeobject.c
908caac52e8e62baa1ee54e4e650e1cd3ac37907 28-Jan-2008 Christian Heimes <christian@cheimes.de> Added clear cache methods to clear the internal type lookup cache for ref leak test runs.
/external/python/cpython2/Objects/typeobject.c
e7bb9188f431b3d5c5c1b53188db33565bcaea2b 27-Jan-2008 Neal Norwitz <nnorwitz@gmail.com> Whitespace cleanup
/external/python/cpython2/Objects/typeobject.c
e4c270c2a887d251966fae5bfc93dbe2b312ee73 14-Jan-2008 Amaury Forgeot d'Arc <amauryfa@gmail.com> Re-apply patch #1700288 (first applied in r59931, rolled back in r59940)
now that ctypes uses a more supported method to create types:

Method cache optimization, by Armin Rigo, ported to 2.6 by Kevin Jacobs.
/external/python/cpython2/Objects/typeobject.c
d1c131a6e30f7777fe65f6b4fa910150f647b5f5 13-Jan-2008 Georg Brandl <georg@python.org> Back out r59931 - test_ctypes fails with it.
/external/python/cpython2/Objects/typeobject.c
27e26ec4181db395deac30bac09bde1fe3e0fc2b 12-Jan-2008 Georg Brandl <georg@python.org> Patch #1700288: Method cache optimization, by Armin Rigo, ported to
2.6 by Kevin Jacobs.
/external/python/cpython2/Objects/typeobject.c
dfe5dc8455de93fddb3030416e41b92d3a0fd267 07-Jan-2008 Georg Brandl <georg@python.org> Make Python compile with --disable-unicode.
/external/python/cpython2/Objects/typeobject.c
30b78048a670bc2a97f28d468d4239cc9a843673 20-Dec-2007 Georg Brandl <georg@python.org> Fix refleak introduced in r59576.
/external/python/cpython2/Objects/typeobject.c
0b7b6fdff3b5bd7974c80a891598aa81ed634e61 19-Dec-2007 Guido van Rossum <guido@python.org> Patch #1549 by Thomas Herve.
This changes the rules for when __hash__ is inherited slightly,
by allowing it to be inherited when one or more of __lt__, __le__,
__gt__, __ge__ are overridden, as long as __eq__ and __ne__ aren't.
/external/python/cpython2/Objects/typeobject.c
e93237dfcc4ee4feee62adafb4e7899487ca864b 19-Dec-2007 Christian Heimes <christian@cheimes.de> #1629: Renamed Py_Size, Py_Type and Py_Refcnt to Py_SIZE, Py_TYPE and Py_REFCNT. Macros for b/w compatibility are available.
/external/python/cpython2/Objects/typeobject.c
64c06e327d48150fc548cf18a4a7ae0b890e69fa 22-Nov-2007 Guido van Rossum <guido@python.org> Backport of _abccoll.py by Benjamin Arangueren, issue 1383.
With some changes of my own thrown in (e.g. backport of r58107).
/external/python/cpython2/Objects/typeobject.c
1e534b5425d836cb58a73d24f0be791d67bf3503 07-Sep-2007 Brett Cannon <bcannon@gmail.com> Fix a crasher where Python code managed to infinitely recurse in C code without
ever going back out to Python code in PyObject_Call(). Required introducing a
static RuntimeError instance so that normalizing an exception there is no
reliance on a recursive call that would put the exception system over the
recursion check itself.
/external/python/cpython2/Objects/typeobject.c
6819210b9e4e5719a6f7f9c1725f8fa70a8936f6 21-Jul-2007 Martin v. Löwis <martin@v.loewis.de> PEP 3123: Provide forward compatibility with Python 3.0, while keeping
backwards compatibility. Add Py_Refcnt, Py_Type, Py_Size, and
PyVarObject_HEAD_INIT.
/external/python/cpython2/Objects/typeobject.c
a84dcd7546c929187a9ae2b620a0d0cc01efc9bb 22-May-2007 Neal Norwitz <nnorwitz@gmail.com> Stop using METH_OLDARGS implicitly
/external/python/cpython2/Objects/typeobject.c
9790a2706573359e02fcfc5f18f9907467f4ec49 02-May-2007 Armin Rigo <arigo@tunes.org> Fix for #1303614 and #1174712:
- __dict__ descriptor abuse for subclasses of built-in types
- subclassing from both ModuleType and another built-in types

Thanks zseil for the patch.
/external/python/cpython2/Objects/typeobject.c
796fc992ce99fc581d635bea6bdf7f7efeb3c477 19-Apr-2007 Armin Rigo <arigo@tunes.org> Fix a usage of the dangerous pattern decref - modify field - incref.
/external/python/cpython2/Objects/typeobject.c
c0ba52d3fd6a4d6211d5a1a4ffe96f1b96fffd74 19-Apr-2007 Armin Rigo <arigo@tunes.org> Revert r53997 as per
http://mail.python.org/pipermail/python-dev/2007-March/071796.html .

I've kept a couple of still-valid extra tests in test_descr, but didn't
bother to sort through the new comments and refactorings added in r53997
to see if some of them could be kept. If so, they could go in a
follow-up check-in.
/external/python/cpython2/Objects/typeobject.c
cbd9ee69eeaadf7a50007532071890b4eaeae664 14-Apr-2007 Neal Norwitz <nnorwitz@gmail.com> When __slots__ are set to a unicode string, make it work the same as
setting a plain string, ie don't expand to single letter identifiers.
/external/python/cpython2/Objects/typeobject.c
f102e24bd34442026f4200a298a8b08d1deb3616 23-Mar-2007 Guido van Rossum <guido@python.org> Add a type.__init__() method that enforces the same signature as
type.__new__(), and then calls object.__init__(cls), just to be anal.

This allows us to restore the code in string.py's _TemplateMetaclass
that called super(...).__init__(name, bases, dct), which I commented
out yesterday since it broke due to the stricter argument checking
added to object.__init__().
/external/python/cpython2/Objects/typeobject.c
143b5640593528a074cc8b9bff8607c829f58b6a 23-Mar-2007 Guido van Rossum <guido@python.org> - Bug #1683368: The object.__init__() and object.__new__() methods are
now stricter in rejecting excess arguments. The only time when
either allows excess arguments is when it is not overridden and the
other one is. For backwards compatibility, when both are
overridden, it is a deprecation warning (for now; maybe a Py3k
warning later).

When merging this into 3.0, the warnings should become errors.

Note: without the change to string.py, lots of spurious warnings happen.
What's going on there?
/external/python/cpython2/Objects/typeobject.c
6f2d09c949ac0c21c56c97e7f772a2726e34d74f 16-Mar-2007 Žiga Seilnacht <ziga.seilnacht@gmail.com> Patch #1623563: allow __class__ assignment for classes with __slots__.
The old and the new class are still required to have the same slot
names, but the order in which they are specified is not relevant.
/external/python/cpython2/Objects/typeobject.c
20f43d3018e3ff474f761d1a03c18cec3291042b 15-Mar-2007 Žiga Seilnacht <ziga.seilnacht@gmail.com> Patch #1462488: prevent a segfault in object_reduce_ex() by splitting
the implementation for __reduce__ and __reduce_ex__ into two separate
functions. Fixes bug #931877. Will backport.
/external/python/cpython2/Objects/typeobject.c
71436f022996b82b2e2518ee5dd08d1a2923eaae 14-Mar-2007 Žiga Seilnacht <ziga.seilnacht@gmail.com> Patch #1680015: Don't modify __slots__ tuple if it contains an unicode
name. Remove a reference leak that happened if the name could not be
converted to string. Will backport.
/external/python/cpython2/Objects/typeobject.c
890320877658121d9def472ae0d7063b81fc3aed 11-Mar-2007 Žiga Seilnacht <ziga.seilnacht@gmail.com> Patch #1675981: remove unreachable code from type.__new__() method.
__dict__ and __weakref__ are removed from the slots tuple earlier
in the code, in the loop that mangles slot names. Will backport.
/external/python/cpython2/Objects/typeobject.c
fa955697fa0986b19abac7b026c8f00b4393adf9 27-Feb-2007 Jeremy Hylton <jeremy@alum.mit.edu> Add checking for a number of metaclass error conditions.

We add some new rules that are required for preserving internal
invariants of types.

1. If type (or a subclass of type) appears in bases, it must appear
before any non-type bases. If a non-type base (like a regular
new-style class) occurred first, it could trick type into
allocating the new class an __dict__ which must be impossible.

2. There are several checks that are made of bases when creating a
type. Those checks are now repeated when assigning to __bases__.
We also add the restriction that assignment to __bases__ may not
change the metaclass of the type.

Add new tests for these cases and for a few other oddball errors that
were no previously tested. Remove a crasher test that was fixed.

Also some internal refactoring: Extract the code to find the most
derived metaclass of a type and its bases. It is now needed in two
places. Rewrite the TypeError checks in test_descr to use doctest.
The tests now clearly show what exception they expect to see.
/external/python/cpython2/Objects/typeobject.c
2d1f5c93bbe3ed6202e14e9d3c3708174b62f8e6 27-Feb-2007 Jeremy Hylton <jeremy@alum.mit.edu> whitespace normalization
/external/python/cpython2/Objects/typeobject.c
ee3a1b5244e60566c5d5c8f6a1ea4b381de99f1c 25-Feb-2007 Neal Norwitz <nnorwitz@gmail.com> Variation of patch # 1624059 to speed up checking if an object is a subclass
of some of the common builtin types.

Use a bit in tp_flags for each common builtin type. Check the bit
to determine if any instance is a subclass of these common types.
The check avoids a function call and O(n) search of the base classes.
The check is done in the various Py*_Check macros rather than calling
PyType_IsSubtype().

All the bits are set in tp_flags when the type is declared
in the Objects/*object.c files because PyType_Ready() is not called
for all the types. Should PyType_Ready() be called for all types?
If so and the change is made, the changes to the Objects/*object.c files
can be reverted (remove setting the tp_flags). Objects/typeobject.c
would also have to be modified to add conditions
for Py*_CheckExact() in addition to each the PyType_IsSubtype check.
/external/python/cpython2/Objects/typeobject.c
fd963265e21686fb306eaa3f0e63c15bfdbcc9ba 09-Feb-2007 Martin v. Löwis <martin@v.loewis.de> Bug #1653736: Properly discard third argument to slot_nb_inplace_power.
Will backport.
/external/python/cpython2/Objects/typeobject.c
f5bee30e30687447d9d532dc298ba0793beb4515 24-Jan-2007 Brett Cannon <bcannon@gmail.com> Fix crasher for when an object's __del__ creates a new weakref to itself.
Patch only fixes new-style classes; classic classes still buggy.

Closes bug #1377858. Already backported.
/external/python/cpython2/Objects/typeobject.c
b3f37556bcb21997a16d117e36eec78474ee0e19 09-Oct-2006 Andrew M. Kuchling <amk@amk.ca> Fix wording in comment
/external/python/cpython2/Objects/typeobject.c
7ccbca93a27e22f0b06316b0d9760fbf7b19cbda 04-Oct-2006 Armin Rigo <arigo@tunes.org> Forward-port of r52136,52138: a review of overflow-detecting code.

* unified the way intobject, longobject and mystrtoul handle
values around -sys.maxint-1.

* in general, trying to entierely avoid overflows in any computation
involving signed ints or longs is extremely involved. Fixed a few
simple cases where a compiler might be too clever (but that's all
guesswork).

* more overflow checks against bad data in marshal.c.

* 2.5 specific: fixed a number of places that were still confusing int
and Py_ssize_t. Some of them could potentially have caused
"real-world" breakage.

* list.pop(x): fixing overflow issues on x was messy. I just reverted
to PyArg_ParseTuple("n"), which does the right thing. (An obscure
test was trying to give a Decimal to list.pop()... doesn't make
sense any more IMHO)

* trying to write a few tests...
/external/python/cpython2/Objects/typeobject.c
5d59c0983431b0b7d3929dd2851b00e20e1d8c15 30-Sep-2006 Georg Brandl <georg@python.org> Patch #1567691: super() and new.instancemethod() now don't accept
keyword arguments any more (previously they accepted them, but didn't
use them).
/external/python/cpython2/Objects/typeobject.c
1872b1c01f343f4cbfa7696ce95beae8278ce210 12-Aug-2006 Neal Norwitz <nnorwitz@gmail.com> Fix a couple of bugs exposed by the new __index__ code. The 64-bit buildbots
were failing due to inappropriate clipping of numbers larger than 2**31
with new-style classes. (typeobject.c) In reviewing the code for classic
classes, there were 2 problems. Any negative value return could be returned.
Always return -1 if there was an error. Also make the checks similar
with the new-style classes. I believe this is correct for 32 and 64 bit
boxes, including Windows64.

Add a test of classic classes too.
/external/python/cpython2/Objects/typeobject.c
8a87f5d37e6aab91ddc4c6491877b6cbd48a12cf 12-Aug-2006 Neal Norwitz <nnorwitz@gmail.com> Patch #1538606, Patch to fix __index__() clipping.

I modified this patch some by fixing style, some error checking, and adding
XXX comments. This patch requires review and some changes are to be expected.
I'm checking in now to get the greatest possible review and establish a
baseline for moving forward. I don't want this to hold up release if possible.
/external/python/cpython2/Objects/typeobject.c
51fc8c456e9bbb97f42c6990e40019cd4a5eb615 09-Aug-2006 Armin Rigo <arigo@tunes.org> Fix and test for an infinite C recursion.
/external/python/cpython2/Objects/typeobject.c
ab2f8f7bd556c16a2b30aa8ec05d4c9d8c50d311 09-Aug-2006 Martin v. Löwis <martin@v.loewis.de> __hash__ may now return long int; the final hash
value is obtained by invoking hash on the long int.
Fixes #1536021.
/external/python/cpython2/Objects/typeobject.c
7a36f5f34456ee1bc5fc65b449f4f81c835ece50 04-Aug-2006 Fred Drake <fdrake@acm.org> SF patch #1534048 (bug #1531003): fix typo in error message
/external/python/cpython2/Objects/typeobject.c
e1fdb32ff2bb1f4b46b56fc1de03f8016bc6c780 21-Jul-2006 Neal Norwitz <nnorwitz@gmail.com> Handle allocation failures gracefully. Found with failmalloc.
Many (all?) of these could be backported.
/external/python/cpython2/Objects/typeobject.c
b114984225c0371a21ce44e037abb452e36e2a6d 23-Jun-2006 Neal Norwitz <nnorwitz@gmail.com> Fix refleak
/external/python/cpython2/Objects/typeobject.c
53c1692f6ac592a8c0d5a6f83017019b52625969 21-Jun-2006 Armin Rigo <arigo@tunes.org> Fix for an obscure bug introduced by revs 46806 and 46808, with a test.
The problem of checking too eagerly for recursive calls is the
following: if a RuntimeError is caused by recursion, and if code needs
to normalize it immediately (as in the 2nd test), then
PyErr_NormalizeException() needs a call to the RuntimeError class to
instantiate it, and this hits the recursion limit again... causing
PyErr_NormalizeException() to never finish.

Moved this particular recursion check to slot_tp_call(), which is not
involved in instantiating built-in exceptions.

Backport candidate.
/external/python/cpython2/Objects/typeobject.c
ccff78525889fe2fa1a3512c4084a407994f9ce3 19-Jun-2006 Georg Brandl <georg@python.org> Patch #1507676: improve exception messages in abstract.c, object.c and typeobject.c.
/external/python/cpython2/Objects/typeobject.c
684fd0c8ec0bad54d3ff39ae15873f80e119478b 25-May-2006 Georg Brandl <georg@python.org> Replace PyObject_CallFunction calls with only object args
with PyObject_CallFunctionObjArgs, which is 30% faster.
/external/python/cpython2/Objects/typeobject.c
4e908107b04b0f4dc64cca89d4a20819e0987620 21-Apr-2006 Thomas Wouters <thomas@python.org> Fix variable/format-char discrepancy in new-style class __getitem__,
__delitem__, __setslice__ and __delslice__ hooks. This caused test_weakref
and test_userlist to fail in the p3yk branch (where UserList, like all
classes, is new-style) on amd64 systems, with open-ended slices: the
sys.maxint value for empty-endpoint was transformed into -1.
/external/python/cpython2/Objects/typeobject.c
429433b30bbfb957c38b1bc0b699cda2fb30db1c 18-Apr-2006 Skip Montanaro <skip@pobox.com> C++ compiler cleanup: bunch-o-casts, plus use of unsigned loop index var in a couple places
/external/python/cpython2/Objects/typeobject.c
ffe23957770437ff7ce223c1790b8eb9c7b82800 16-Apr-2006 Tim Peters <tim.peters@gmail.com> Remove now-unused variables from tp_traverse and tp_clear methods.
/external/python/cpython2/Objects/typeobject.c
c6e55068cad6f2178981eec4f0a0a583b8bba21a 15-Apr-2006 Thomas Wouters <thomas@python.org> Use Py_VISIT in all tp_traverse methods, instead of traversing manually or
using a custom, nearly-identical macro. This probably changes how some of
these functions are compiled, which may result in fractionally slower (or
faster) execution. Considering the nature of traversal, visiting much of the
address space in unpredictable patterns, I'd argue the code readability and
maintainability is well worth it ;P
/external/python/cpython2/Objects/typeobject.c
edf17d8798e65c10c970ef86f7374f6c1b51027a 15-Apr-2006 Thomas Wouters <thomas@python.org> Use Py_CLEAR instead of in-place DECREF/XDECREF or custom macros, for
tp_clear methods.
/external/python/cpython2/Objects/typeobject.c
ee36d650bbc7dc85b3290a6d95f21ad637731605 11-Apr-2006 Martin v. Löwis <martin@v.loewis.de> Correct casts to char*.
/external/python/cpython2/Objects/typeobject.c
a62862120ddc4636f8819b3f3003ea94c5db0d21 11-Apr-2006 Anthony Baxter <anthonybaxter@gmail.com> More low-hanging fruit. Still need to re-arrange some code (or find a better
solution) in the same way as listobject.c got changed. Hoping for a better
solution.
/external/python/cpython2/Objects/typeobject.c
314861c568d4bf10af1102823e23c9efe648fa0c 30-Mar-2006 Armin Rigo <arigo@tunes.org> Minor bugs in the __index__ code (PEP 357), with tests.
/external/python/cpython2/Objects/typeobject.c
347b30042b68e80b245a03b23cb616024ecb1f1e 30-Mar-2006 Georg Brandl <georg@python.org> Remove unnecessary casts in type object initializers.
/external/python/cpython2/Objects/typeobject.c
5c170fd4a9d2bc2e475d718cbbce526cad4a3eaa 17-Mar-2006 Georg Brandl <georg@python.org> Fix some missing checks after PyTuple_New, PyList_New, PyDict_New
/external/python/cpython2/Objects/typeobject.c
692cdbc5d648da5239b5caececc954960aa024e9 10-Mar-2006 Guido van Rossum <guido@python.org> Fix three nits found by Coverity, adding null checks and comments.
/external/python/cpython2/Objects/typeobject.c
38fff8c4e4276e4e57660a78f305e68bfa87874b 07-Mar-2006 Guido van Rossum <guido@python.org> Checking in the code for PEP 357.
This was mostly written by Travis Oliphant.
I've inspected it all; Neal Norwitz and MvL have also looked at it
(in an earlier incarnation).
/external/python/cpython2/Objects/typeobject.c
725507b52ec40ab49ad87596fff7434322b9b5b1 07-Mar-2006 Martin v. Löwis <martin@v.loewis.de> Change int to Py_ssize_t in several places.
Add (int) casts to silence compiler warnings.
Raise Python exceptions for overflows.
/external/python/cpython2/Objects/typeobject.c
15e62742fad688b026ba80bf17d1345c4cbd423b 27-Feb-2006 Martin v. Löwis <martin@v.loewis.de> Revert backwards-incompatible const changes.
/external/python/cpython2/Objects/typeobject.c
c255c7bef7621596869f56d887ac3ccd5b536708 20-Feb-2006 Georg Brandl <georg@python.org> Bug #1086854: Rename PyHeapType members adding ht_ prefix.
/external/python/cpython2/Objects/typeobject.c
eb079f1c2533bcefcab3ef4c07b800e5bd37239f 16-Feb-2006 Martin v. Löwis <martin@v.loewis.de> Use Py_ssize_t for counts and sizes.
Convert Py_ssize_t using PyInt_FromSsize_t
/external/python/cpython2/Objects/typeobject.c
2c95cc6d72957296c46bb11362359675a47e2085 16-Feb-2006 Martin v. Löwis <martin@v.loewis.de> Support %zd in PyErr_Format and PyString_FromFormat.
/external/python/cpython2/Objects/typeobject.c
18e165558b24d29e7e0ca501842b9236589b012a 15-Feb-2006 Martin v. Löwis <martin@v.loewis.de> Merge ssize_t branch.
/external/python/cpython2/Objects/typeobject.c
50bf51a3a987121b92cb7b2e2c3097075ea6b2be 02-Jan-2006 Neal Norwitz <nnorwitz@gmail.com> Fix ref/memory leak introduced in rev 41845.
/external/python/cpython2/Objects/typeobject.c
037d1e0ff38f4ae2867c4b90d263ecd8aa2df585 29-Dec-2005 Armin Rigo <arigo@tunes.org> SF bug #1153075: "PyXxx_Check(x) trusts x->ob_type->tp_mro".

A patch by mwh to check that user-defined mro's are reasonable
enough.
/external/python/cpython2/Objects/typeobject.c
fd163f92cee2aa8189879bd43670782f4cfd2cf8 29-Dec-2005 Armin Rigo <arigo@tunes.org> SF patch #1390657:

* set sq_repeat and sq_concat to NULL for user-defined new-style
classes, as a way to fix a number of related problems. See
test_descr.notimplemented()). One of these problems was fixed
in r25556 and r25557 but many more existed; this is a general
fix and thus reverts r25556-r25557.

* to avoid having PySequence_Repeat()/PySequence_Concat() failing
on user-defined classes, they now fall back to nb_add/nb_mul if
sq_concat/sq_repeat are not defined and the arguments appear to
be sequences.

* added tests.

Backport candidate.
/external/python/cpython2/Objects/typeobject.c
af68c874a6803b4e90b616077a602c0593719a1d 10-Dec-2005 Jeremy Hylton <jeremy@alum.mit.edu> Add const to several API functions that take char *.

In C++, it's an error to pass a string literal to a char* function
without a const_cast(). Rather than require every C++ extension
module to put a cast around string literals, fix the API to state the
const-ness.

I focused on parts of the API where people usually pass literals:
PyArg_ParseTuple() and friends, Py_BuildValue(), PyMethodDef, the type
slots, etc. Predictably, there were a large set of functions that
needed to be fixed as a result of these changes. The most pervasive
change was to make the keyword args list passed to
PyArg_ParseTupleAndKewords() to be a const char *kwlist[].

One cast was required as a result of the changes: A type object
mallocs the memory for its tp_doc slot and later frees it.
PyTypeObject says that tp_doc is const char *; but if the type was
created by type_new(), we know it is safe to cast to char *.
/external/python/cpython2/Objects/typeobject.c
3e0055f8c65c407e74ce476b8e2b1fb889723514 20-Oct-2005 Jeremy Hylton <jeremy@alum.mit.edu> Merge ast-branch to head

This change implements a new bytecode compiler, based on a
transformation of the parse tree to an abstract syntax defined in
Parser/Python.asdl.

The compiler implementation is not complete, but it is in stable
enough shape to run the entire test suite excepting two disabled
tests.
/external/python/cpython2/Objects/typeobject.c
ec862b907aff99a4f256b946764f349f4d1d0c5c 25-Sep-2005 Armin Rigo <arigo@tunes.org> (pedronis, arigo)
segfault when a class contain a non-list value in the (undocumented)
special attribute __slotnames__.
/external/python/cpython2/Objects/typeobject.c
630db60a5533a3267e2cc07047498fad604e3c91 20-Sep-2005 Guido van Rossum <guido@python.org> - On 64-bit platforms, when __len__() returns a value that cannot be
represented as a C int, raise OverflowError.

(Forward port from 2.4.2; the patch to classobject.c was already in
but needed a correction in the error message text.)
/external/python/cpython2/Objects/typeobject.c
56616999950e151bed766a076e6a6b10f3492f8c 03-Jun-2005 Anthony Baxter <anthonybaxter@gmail.com> fix object.__divmod__.__doc__

backport candidate
/external/python/cpython2/Objects/typeobject.c
7726dc0a8e2951e1fd75353e7d8c16284d0d4653 15-May-2005 Armin Rigo <arigo@tunes.org> Fixed a quite misleading comment: a "not" should not have been there.
/external/python/cpython2/Objects/typeobject.c
b67cc80bb915680190eaf1c9feba8fe0799c83f8 03-Mar-2005 Raymond Hettinger <python@rcn.com> SF bug #1155938: Missing None check for __init__().
/external/python/cpython2/Objects/typeobject.c
f4aca755bc9f26b51b6820a162a3f76c2a1a1abc 23-Sep-2004 Tim Peters <tim.peters@gmail.com> A static swapped_op[] array was defined in 3 different C files, & I think
I need to define it again. Bite the bullet and define it once as an
extern, _Py_SwappedOp[].
/external/python/cpython2/Objects/typeobject.c
bf608750adb3ae13dbc20eca22a3099e810ad673 18-Aug-2004 Martin v. Löwis <martin@v.loewis.de> Patch #980082: Missing INCREF in PyType_Ready.
/external/python/cpython2/Objects/typeobject.c
3f3b66823f899868b86722d586a6cd00df4cbad9 03-Aug-2004 Michael W. Hudson <mwh@python.net> Repair the same thinko in two places about handling of _Py_RefTotal in
the case of __del__ resurrecting an object.
This makes the apparent reference leaks in test_descr go away (which I
expected) and also kills off those in test_gc (which is more surprising
but less so once you actually think about it a bit).
/external/python/cpython2/Objects/typeobject.c
8d726eef968177acaae2a6daa7fe8fb5a8026c42 26-Jun-2004 Raymond Hettinger <python@rcn.com> Cosmetic spacing fix.
/external/python/cpython2/Objects/typeobject.c
d56cbe57b8f57156420130c1a4b9868e743b0242 26-Jun-2004 Raymond Hettinger <python@rcn.com> Fix leak found by Eric Huss.
/external/python/cpython2/Objects/typeobject.c
3ecdb250afb74f77b1148dea2bf08775f9de2ab3 11-Jun-2004 Anthony Baxter <anthonybaxter@gmail.com> Fix for bug #966623 - classes created with type() in an exec(, {}) don't
have a __module__. Test for this case.

Bugfix candidate, will backport.
/external/python/cpython2/Objects/typeobject.c
ff365c931b063db51395118d1817506f0f0cea1f 25-Mar-2004 Hye-Shik Chang <hyeshik@gmail.com> Get rid of gcc warning.
/external/python/cpython2/Objects/typeobject.c
91a968af7640348d92011e305127d5968958aff4 25-Mar-2004 Phillip J. Eby <pje@telecommunity.com> Ensure super() lookup of descriptor from classmethod works (SF #743627)
/external/python/cpython2/Objects/typeobject.c
8a1a5945908c7a0b2b487a98431ff46ab934014a 08-Feb-2004 Jim Fulton <jim@zope.com> Fixed a bug in object.__reduce_ex__ (reduce_2) when using protocol
2. Failure to clear the error when attempts to get the __getstate__
attribute fail caused intermittent errors and odd behavior.
/external/python/cpython2/Objects/typeobject.c
6a8bbdbe7b97cbcafdf32db9d733441a5ff20683 13-Dec-2003 Raymond Hettinger <python@rcn.com> Improve argument checking speed.
/external/python/cpython2/Objects/typeobject.c
8f5cdaa784f555149adf5e94fd2e989f99d6b1db 13-Dec-2003 Raymond Hettinger <python@rcn.com> * Added a new method flag, METH_COEXIST.

* Used the flag to optimize set.__contains__(), dict.__contains__(),
dict.__getitem__(), and list.__getitem__().
/external/python/cpython2/Objects/typeobject.c
0bd743cee17ab8a96122ca0cc692419232a3d3bb 13-Nov-2003 Tim Peters <tim.peters@gmail.com> subtype_dealloc(): Simplified overly contorted retracking logic. With
this change, I think subtype_dealloc is actually a smidgen less obscure
than it was in 2.3 -- we got rid of a negation in an "if" <wink>.
/external/python/cpython2/Objects/typeobject.c
f7f9e9966bbb5f8bf393006720d2e87167e81847 13-Nov-2003 Tim Peters <tim.peters@gmail.com> subtype_dealloc(): A more complete fix for critical bug 840829 +
expanded the test case with a piece that needs the more-complete fix.

I'll backport this to 2.3 maint.
/external/python/cpython2/Objects/typeobject.c
add09b4149b17afa30aa042dbb718b9d9ec741c3 12-Nov-2003 Tim Peters <tim.peters@gmail.com> SF bug 840829: weakref callbacks and gc corrupt memory.

subtype_dealloc(): This left the dying object exposed to gc, so that
if cyclic gc triggered during the weakref callback, gc tried to delete
the dying object a second time. That's a disaster. subtype_dealloc()
had a (I hope!) unique problem here, as every normal dealloc routine
untracks the object (from gc) before fiddling with weakrefs etc. But
subtype_dealloc has obscure technical reasons for re-registering the
dying object with gc (already explained in a large comment block at
the bottom of the function).

The fix amounts to simply refraining from reregistering the dying object
with gc until after the weakref callback (if any) has been called.

This is a critical bug (hard to predict, and causes seemingly random
memory corruption when it occurs). I'll backport it to 2.3 later.
/external/python/cpython2/Objects/typeobject.c
f0dfc7ac5c2f76baaae0c3b45bc339281cfa2adc 20-Oct-2003 Walter Dörwald <walter@livinglogic.de> Fix a bunch of typos in documentation, docstrings and comments.
(From SF patch #810751)
/external/python/cpython2/Objects/typeobject.c
8ae468965700fd9900efc28bff8fa2015dae2bef 12-Oct-2003 Raymond Hettinger <python@rcn.com> Simplify and speedup uses of Py_BuildValue():

* Py_BuildValue("(OOO)",a,b,c) --> PyTuple_Pack(3,a,b,c)
* Py_BuildValue("()",a) --> PyTuple_New(0)
* Py_BuildValue("O", a) --> Py_INCREF(a)
/external/python/cpython2/Objects/typeobject.c
56bb16f1b37bd51a4f1a9386523d66c8c14fd6f0 11-Oct-2003 Raymond Hettinger <python@rcn.com> Use the simpler and faster PyArg_UnpackTuple() instead of
PyArg_ParseTuple() where possible.
/external/python/cpython2/Objects/typeobject.c
f34f2646a140c4b59ffcdeb7b55e61962b8bc249 11-Oct-2003 Raymond Hettinger <python@rcn.com> SF bug #820397: __nonzero__() returns 1/0

Altered to return a PyBool instead of a PyInt.

Backport candidate.
/external/python/cpython2/Objects/typeobject.c
22c3dda1e64f413d4f6781d983067d580567071b 09-Oct-2003 Guido van Rossum <guido@python.org> Fix leak introduced by previous typeobject.c checkin.
/external/python/cpython2/Objects/typeobject.c
02c58f865c82021d1cde7064552d3a95301c8cc0 08-Oct-2003 Guido van Rossum <guido@python.org> SF patch #820195 by Wojtek Walczak (gminick at users.sourceforge.net):
make obj.__contains__() returns True/False instead of 1/0.
/external/python/cpython2/Objects/typeobject.c
b2c7de46673e654aec8d2c9b000cce2b071a5093 15-Aug-2003 Michael W. Hudson <mwh@python.net> Fix for

[ 784825 ] fix obscure crash in descriptor handling

Should be applied to release23-maint and in all likelyhood
release22-maint, too.

Certainly doesn't apply to release21-maint.
/external/python/cpython2/Objects/typeobject.c
a6a277d8316973ca3f546e5111430a8c4ee07181 08-Aug-2003 Michael W. Hudson <mwh@python.net> /* XXX From here until type is allocated, "return NULL" leaks bases! */

Sure looks like it to me! <wink>

When I run the leak2.py script I posted to python-dev, I only see
three reference leaks in all of test_descr. When I run
test_descr.test_main, I still see 46 leaks. This clearly demands
posting a yelp to python-dev :-)

This certainly should be applied to release23-maint, and in all
likelyhood release22-maint as well.
/external/python/cpython2/Objects/typeobject.c
e723e453a1f11f4865f25d93d3cf20280d9f831a 07-Aug-2003 Michael W. Hudson <mwh@python.net> Repair refcounting on error return from type_set_bases.

Include a test case that failed for one of my efforts to repair this.
/external/python/cpython2/Objects/typeobject.c
f75d9fce1689f3e7768fd425858469dc91cbff58 16-Jul-2003 Jeremy Hylton <jeremy@alum.mit.edu> Remove stray comments.
/external/python/cpython2/Objects/typeobject.c
1c7a0ea05624b7967200e07ee345d26564b11b66 16-Jul-2003 Jeremy Hylton <jeremy@alum.mit.edu> Remove unnecessary check in tests for slots allowed.

The !PyType_Check(base) check snuck in as part of rev 2.215, but was
unrelated to the SF patch that is mentioned in the checkin comment.
The test is currently unnecessary because base is set to the return
value of best_bases(), which returns a type or NULL.
/external/python/cpython2/Objects/typeobject.c
3e3159ce6ac6dc27d17b99ba758c1322a67427bb 27-Jun-2003 Jeremy Hylton <jeremy@alum.mit.edu> Require that __nonzero__() return a bool or exactly an int.
/external/python/cpython2/Objects/typeobject.c
090a3495b3ff38750192550fd2f80b4c3552cd95 27-Jun-2003 Jeremy Hylton <jeremy@alum.mit.edu> Check return type of __nonzero__() method.

The language reference says you must return an int or a bool. This
fix limits the scope of SF bug 759227 (infinite recursion) to
subclasses of int.
/external/python/cpython2/Objects/typeobject.c
59195fdf40c3e3f066390ed2e23873aed1286e86 13-Jun-2003 Guido van Rossum <guido@python.org> - SF patch 751998 fixes an unwanted side effect of the previous fix
for SF bug 742860 (the next item).
/external/python/cpython2/Objects/typeobject.c
10147f7d1321441e46463fd8aa18bc2dd0be6c2d 11-Jun-2003 Brett Cannon <bcannon@gmail.com> Fixed a comment.
/external/python/cpython2/Objects/typeobject.c
e2fdc610043a29a4e95287ff53b1a2c43e401b11 08-Jun-2003 Neal Norwitz <nnorwitz@gmail.com> Fix SF #749831, copy raises SystemError when getstate raises exception
/external/python/cpython2/Objects/typeobject.c
1987c6693bbd83e27202ff8c1a8a3f8d53ecc5ed 29-May-2003 Guido van Rossum <guido@python.org> Fix for SF 742911. We now clear the weakrefs *before* calling __del__
or emptying __dict__, just as we do for classic classes.
/external/python/cpython2/Objects/typeobject.c
3cfe75470d1f77468be01002d09d884c3a431827 21-May-2003 Tim Peters <tim.peters@gmail.com> PyType_Ready(): Complain if the type is a base type, and gc'able, and
tp_free is NULL or PyObject_Del at the end. Because it's a base type
it must call tp_free in its dealloc function, and because it's gc'able
it must not call PyObject_Del.

inherit_slots(): Don't inherit tp_free unless the type and its base
agree about whether they're gc'able. If the type is gc'able and the
base is not, and the base uses the default PyObject_Del for its
tp_free, give the type PyObject_GC_Del for its tp_free (the appropriate
default for a gc'able type).

cPickle.c: The Pickler and Unpickler types claim to be base classes
and gc'able, but their dealloc functions didn't call tp_free.
Repaired that. Also call PyType_Ready() on these typeobjects, so
that the correct (PyObject_GC_Del) default memory-freeing function
gets plugged into these types' tp_free slots.
/external/python/cpython2/Objects/typeobject.c
be67d87e4d6a63faefef40888a966a663ae54380 20-May-2003 Brett Cannon <bcannon@gmail.com> Fixing the previous patch to have the changes be to the proper docstrings.
/external/python/cpython2/Objects/typeobject.c
154da9b7e2c8e713788cfaa8d25d8c21edd826f9 20-May-2003 Brett Cannon <bcannon@gmail.com> Fix docstrings for __(get|set|del)slice__ to mention that negative indices are not supported.
/external/python/cpython2/Objects/typeobject.c
a94568a7535de60f1144e4eea0d027b87017a4b4 10-May-2003 Martin v. Löwis <martin@v.loewis.de> Patch #734231: Update RiscOS support. In particular, correct
riscospath.extsep, and use os.extsep throughout.
/external/python/cpython2/Objects/typeobject.c
636688d470e4df7220e7f541a495155077cc0353 23-Apr-2003 Guido van Rossum <guido@python.org> Improve the message about metatype/metaclass conflicts.
/external/python/cpython2/Objects/typeobject.c
6cc5bb685db13616f3f6474b9556d9bfc5195b20 16-Apr-2003 Guido van Rossum <guido@python.org> Sigh. The crucial change was still missing from the previous
checkin. :-(
/external/python/cpython2/Objects/typeobject.c
76ba09fd81246c21f0de25f559d4da47b457f2e2 16-Apr-2003 Guido van Rossum <guido@python.org> - super() no longer ignores data descriptors, except __class__. See
the thread started at
http://mail.python.org/pipermail/python-dev/2003-April/034338.html
/external/python/cpython2/Objects/typeobject.c
19a02ba69dd908bcc5fe45263fb9c956ed9f7ffc 16-Apr-2003 Guido van Rossum <guido@python.org> Fix three (!) object leaks in the code for assignment to __bases__.
/external/python/cpython2/Objects/typeobject.c
52b2705e9cadfa4cd79ad51cbff67c4882c0874e 15-Apr-2003 Guido van Rossum <guido@python.org> Ouch, it's Carlo Verre, not Verre Carlo.
/external/python/cpython2/Objects/typeobject.c
4dcdb78c6ffd203c9d72ef41638cc4a0e3857adf 14-Apr-2003 Guido van Rossum <guido@python.org> Close off the "Verre Carlo hack" as discussed on python-dev.
/external/python/cpython2/Objects/typeobject.c
2fd02eb80fdfd7b651d3df7e09a0b076e126cc03 14-Apr-2003 Guido van Rossum <guido@python.org> super_getattro(): kill some dead code; explain a mystery.
/external/python/cpython2/Objects/typeobject.c
d06483c2f680164093a7d8f0eaef7edc1fa35d10 09-Apr-2003 Jeremy Hylton <jeremy@alum.mit.edu> Missing DECREF.
/external/python/cpython2/Objects/typeobject.c
f394df47fd943d7067b5c3bedbf2c359d864923c 06-Apr-2003 Raymond Hettinger <python@rcn.com> SF bug #699934: Obscure error message

mwh pointed out that the error message did not
make sense if obtained by rearranging the bases.
/external/python/cpython2/Objects/typeobject.c
8d24ee97dfa0e300f8b775faee7a53ad2a02ecac 25-Mar-2003 Guido van Rossum <guido@python.org> Refactoring: rename update_these_slots() into update_subclasses() and
generalize to take a callback function and a void * data argument.
This might come in handy later... :-)
/external/python/cpython2/Objects/typeobject.c
7571a0fbcf6fd5d6014008f566f970c84cff7d95 23-Mar-2003 Tim Peters <tim.peters@gmail.com> Improved new Py_TRACE_REFS gimmicks.
Arranged that all the objects exposed by __builtin__ appear in the list
of all objects. I basically peed away two days tracking down a mystery
leak in sys.gettotalrefcount() in a ZODB app (== tons of code), because
the object leaking the references didn't appear in the sys.getobjects(0)
list. The object happened to be False. Now False is in the list, along
with other popular & previously missing leak candidates (like None).
Alas, we still don't have a choke point covering *all* Python objects,
so the list of all objects may still be incomplete.
/external/python/cpython2/Objects/typeobject.c
bf9b24464e11d9db2980c018f4d67b50b3573903 23-Mar-2003 Tim Peters <tim.peters@gmail.com> slot_sq_contains(): This leaked a reference to the result of calling
__contains__().

Bugfix candidate.
/external/python/cpython2/Objects/typeobject.c
36eb4dfb819dbfe90d82e0c6b58bd360c22bcc26 23-Mar-2003 Tim Peters <tim.peters@gmail.com> Refactored some of the Py_TRACE_REFS code. New private API function
_Py_AddToAllObjects() that simply inserts an object at the front of
the doubly-linked list of all objects. Changed PyType_Ready() (the
closest thing we've got to a choke point for type objects) to call
that.
/external/python/cpython2/Objects/typeobject.c
83245b58280a7679da0fe7216f36353e44ddf859 12-Mar-2003 Raymond Hettinger <python@rcn.com> SF bug #699934: Obscure error message

Clarify error message for mro conflicts.
/external/python/cpython2/Objects/typeobject.c
e5c691abe3946ddbaa00730b92f3b96f96903f7d 07-Mar-2003 Guido van Rossum <guido@python.org> - The extended type structure used for heap types (new-style
classes defined by Python code using a class statement) is now
exported from object.h as PyHeapTypeObject. (SF patch #696193.)
/external/python/cpython2/Objects/typeobject.c
036f999669d9d32e74442c9b5e5ba94a85ae282c 21-Feb-2003 Guido van Rossum <guido@python.org> Implementing the salient parts of __reduce_ex__ in C.
This still falls back to helpers in copy_reg for:
- pickle protocols < 2
- calculating the list of slot names (done only once per class)
- the __newobj__ function (which is used as a token but never called)
/external/python/cpython2/Objects/typeobject.c
c53f009f94a5758530e6f35d8e7ed64c8efcb74b 18-Feb-2003 Guido van Rossum <guido@python.org> Introducing __reduce_ex__, which is called with a protocol number argument
if it exists in preference over __reduce__. Now Tim can go implement this
in cPickle.c.
/external/python/cpython2/Objects/typeobject.c
97e5ff555e581e30c21f703bf5ca89402db6f557 18-Feb-2003 Tim Peters <tim.peters@gmail.com> Removed unreferenced label.
/external/python/cpython2/Objects/typeobject.c
8e80a72be402c926250471d7d8d84414629c683f 18-Feb-2003 Guido van Rossum <guido@python.org> The recent changes to super(), in particular supercheck(), broke when
using super() for an instance in a metaclass situation. Because the
class was a metaclass, the instance was a class, and hence the
PyType_Check() branch was taken. But this branch didn't apply. Make
it so that if this branch doesn't apply, the other branch is still
tried. All tests pass.
/external/python/cpython2/Objects/typeobject.c
298e4214538a7196c27ec22b1f01506fdb3c4039 13-Feb-2003 Guido van Rossum <guido@python.org> SF patch #685738 by Michael Stone.

This changes the default __new__ to refuse arguments iff tp_init is the
default __init__ implementation -- thus making it a TypeError when you
try to pass arguments to a constructor if the class doesn't override at
least __init__ or __new__.
/external/python/cpython2/Objects/typeobject.c
a89d10edc94b3c1c62a6920d4b6b8219675f36da 12-Feb-2003 Guido van Rossum <guido@python.org> Implement another useful feature for proxies: in super(X, x), x may
now be a proxy for an X instance, as long as issubclass(x.__class__, X).
/external/python/cpython2/Objects/typeobject.c
eea4718e814b8ec054557aa87d6c122305bf6f0b 11-Feb-2003 Guido van Rossum <guido@python.org> Fix from SF #681367: inherit tp_as_buffer. This only applies to C
types -- Python types already inherited this.
/external/python/cpython2/Objects/typeobject.c
9af48ff44ea5e096495d9652f6164b45a369144a 11-Feb-2003 Guido van Rossum <guido@python.org> Inline create_specialmethod() -- since METH_CLASS is done differently
now, it was only called once, and its existence merely obfuscates the
control flow.
/external/python/cpython2/Objects/typeobject.c
82ed25c15a8f79011161356cae5fffb49af8b24a 11-Feb-2003 Guido van Rossum <guido@python.org> Add basic arg sanity checking to wrap_descr_get(). This is called
when Python code calls a descriptor's __get__ method. It should
translate None to NULL in both argument positions, and insist that at
least one of the argument positions is not NULL after this
transformation.
/external/python/cpython2/Objects/typeobject.c
3f50cdc05e5254e1ce012ceca449387d50d28bc5 10-Feb-2003 Guido van Rossum <guido@python.org> Get rid of the "bozo" __getstate__ that was inserted when __slots__
was used. This simplifies some logic in copy_reg.py (used by
pickling). It also broke a test, but this was rewritten to test the
new feature. :-)
/external/python/cpython2/Objects/typeobject.c
c9172d3832c2bbdf093f3ec428574d83407f46c8 06-Feb-2003 Andrew M. Kuchling <amk@amk.ca> Comment typo fix
/external/python/cpython2/Objects/typeobject.c
ce8bcd8405593371ae7f16fbfefae3ef0db274a0 05-Feb-2003 Guido van Rossum <guido@python.org> Fix for SF #668433. I'm not explaining it here; ample comments are in
the code.
/external/python/cpython2/Objects/typeobject.c
373c7412f297c375d84c5984f753557b441dd6f4 07-Jan-2003 Guido van Rossum <guido@python.org> Fix for SF bug #642358: only provide a new with a __dict__ or
__weaklist__ descriptor if we added __dict__ or __weaklist__,
respectively. With unit test.
/external/python/cpython2/Objects/typeobject.c
cd118803b5aa124bcfd8a12f28c22c4cf37c9de7 06-Jan-2003 Guido van Rossum <guido@python.org> Add a refinement to SLOT1BINFULL() that fixes the problem reported in
SF bug #623669: only try (e.g.) __rdiv__ before __div__ if the right
class actually overrides it.
/external/python/cpython2/Objects/typeobject.c
768158c11b0ad571b7e6c9337aa39bae4b3958e3 31-Dec-2002 Guido van Rossum <guido@python.org> Fix an out-of-bound index in pmerge() discovered by Zooko (SF bug
645404). I'm not 100% sure this is the right fix, so I'll keep the
bug report open for Samuele, but this fixes the index error and passes
the test suite (and I can't see why it *shouldn't* be the right fix
:-).
/external/python/cpython2/Objects/typeobject.c
a828586c3a2a2c07558f8872ef115adc3e24ad9f 14-Dec-2002 Raymond Hettinger <python@rcn.com> Punctuation fix.
/external/python/cpython2/Objects/typeobject.c
3bbc0eea1045657a054cf302ca98d1236eab058b 13-Dec-2002 Guido van Rossum <guido@python.org> Tighten the tests for assignment to __bases__: disallow empty tuple.
/external/python/cpython2/Objects/typeobject.c
bca1cbc6f895c7f9f003877b1cfc0c649387ae1c 09-Dec-2002 Tim Peters <tim.peters@gmail.com> SF 548651: Fix the METH_CLASS implementation.
Most of these patches are from Thomas Heller, with long lines folded
by Tim. The change to test_descr.py is from Guido. See the bug report.

Not a bugfix candidate -- METH_CLASS is new in 2.3.
/external/python/cpython2/Objects/typeobject.c
ea7f75d423342ebab09d1e12e02af6c2bab128ec 07-Dec-2002 Tim Peters <tim.peters@gmail.com> slot_nb_nonzero(): Another leak uncovered by the sandbox datetime
tests. I found the logic too confusing to follow here, so rewrote more
than was likely absolutely necessary.

Bugfix candidate.
/external/python/cpython2/Objects/typeobject.c
61ce0a9bae6e97f25034370eda2fe87ef654e434 07-Dec-2002 Tim Peters <tim.peters@gmail.com> slot_tp_hash(): In the normal path, this leaked a reference to the
integer hash object returned by __hash__(). This accounts for some of
the "mystery leaks" in the sandbox datetime tests, but probably not
all of them.
/external/python/cpython2/Objects/typeobject.c
ade8c8b2c3a158013564a6adbd92686b5f3340c9 27-Nov-2002 Michael W. Hudson <mwh@python.net> Nudge getting __module__ and __name__ for new-style classes so that
the results of *setting* __name__ are not so surprising.

If people can suggest more tests, that'd be grand, or is what's there
sufficient?
/external/python/cpython2/Objects/typeobject.c
7e7c00db0cc8621d6020f2552a6dba86b4d08d6f 27-Nov-2002 Michael W. Hudson <mwh@python.net> I don't know why staring at the email to python-checkins made me
see problems with my code that I didn't see before the checkin, but:

When a subtype .mro() fails, we need to reset the type whose __bases__
are being changed, too. Fix + test.
/external/python/cpython2/Objects/typeobject.c
586da8fddd6bcf5dd7a2e6a99394f218424a87ca 27-Nov-2002 Michael W. Hudson <mwh@python.net> Readjustments to the way we cope with exceptions from subclasses'
mro() methods. Now any exception aborts the whole __bases__ change.

And more tests.
/external/python/cpython2/Objects/typeobject.c
caf17be1b7886f4c51558fb10ec8a51483102d38 27-Nov-2002 Michael W. Hudson <mwh@python.net> I had the inheritance cycle stuff backwards. Oops!
/external/python/cpython2/Objects/typeobject.c
ac74f5d44b358b331fc46c7ad7f92698e20510f2 26-Nov-2002 Michael W. Hudson <mwh@python.net> Initialize a variable. Hope this makes things work for Guido.

It's odd that gcc on my ibook didn't complain about this.
/external/python/cpython2/Objects/typeobject.c
98bbc49c54c4bc7de33f1f23fc364dbb8e3fe034 26-Nov-2002 Michael W. Hudson <mwh@python.net> This is my patch:

[ 635933 ] make some type attrs writable

Plus a couple of extra tests beyond what's up there.

It hasn't been as carefully reviewed as it perhaps should, so all readers
are encouraged, nay exhorted, to give this a close reading.

There are still a couple of oddities related to assigning to __name__,
but I intend to solicit python-dev's opinions on these.
/external/python/cpython2/Objects/typeobject.c
98f3373a8c1ab076c07c371ffc0e7dfd3da8a0ce 25-Nov-2002 Guido van Rossum <guido@python.org> A tweaked version of Jeremy's patch #642489, to produce better error
messages about MRO conflicts. (The tweaks include correcting spelling
errors, some refactoring to get the name of classic classes, and a
style nit or two.)
/external/python/cpython2/Objects/typeobject.c
9a6b8d8cf89236f92282ce7526d2d913d2afe643 15-Nov-2002 Tim Peters <tim.peters@gmail.com> Repaired illegal syntax most compilers probably let slide (but MSVC
treats as a fatal error).
/external/python/cpython2/Objects/typeobject.c
1f1213120e40e1d1cb58348ada03da27471e9f5e 14-Nov-2002 Guido van Rossum <guido@python.org> Use the new C3 MRO algorithm, implemented by Samuele Pedroni (SF patch
619475; also closing SF bug 618704). I tweaked his code a bit for
style.

This raises TypeError for MRO order disagreements, which is an
improvement (previously these went undetected) but also a degradation:
what if the order disagreement doesn't affect any method lookups?
I don't think I care.
/external/python/cpython2/Objects/typeobject.c
673cd824ba009ecbb0723192867c27c8e27c0037 18-Oct-2002 Neal Norwitz <nnorwitz@gmail.com> Fix SF # 624982, Potential AV in slot_sq_item, by Greg Chapman

Don't crash when getting value of a property raises an exception
/external/python/cpython2/Objects/typeobject.c
3930bc35d0aeb5a111793da634806ed6dec2161e 18-Oct-2002 Guido van Rossum <guido@python.org> Sigh. That wasn't a memory leak, that was Guido committing before
running tests. Withdraw 2.183 and its backport.
/external/python/cpython2/Objects/typeobject.c
72297bb71e3b0dd420c94fa5ed90038e445334d8 18-Oct-2002 Guido van Rossum <guido@python.org> Fix memory leak in add_subclass() found by NealN with valgrind.
Will backport.
/external/python/cpython2/Objects/typeobject.c
6e5680fc83f3cb66af9c0f3b29ac84d2765293e1 15-Oct-2002 Guido van Rossum <guido@python.org> For some reason (probably cut and paste), __ipow__ for new-style
classes was called with three arguments. This makes no sense, there's
no way to pass in the "modulo" 3rd argument as for __pow__, and
classic classes don't do this. [SF bug 620179]

I don't want to backport this to 2.2.2, because it could break
existing code that has developed a work-around. Code in 2.2.2 that
wants to use __ipow__ and wants to be forward compatible with 2.3
should be written like this:

def __ipow__(self, exponent, modulo=None):
...
/external/python/cpython2/Objects/typeobject.c
13b1a5cc990e4bbffa47d58a6769b5940da7548e 14-Oct-2002 Martin v. Löwis <martin@v.loewis.de> Don't drop old slots if _unicode_to_string did not change anything.
/external/python/cpython2/Objects/typeobject.c
d919a59ab58be7dec14ea78c182b8d4545559adb 14-Oct-2002 Martin v. Löwis <martin@v.loewis.de> Allow Unicode strings in __slots__, converting them to byte strings.
/external/python/cpython2/Objects/typeobject.c
84b2bed4359e27070fe2eac4b464d4a1bc6e150d 16-Aug-2002 Guido van Rossum <guido@python.org> Squash a few calls to the hideously expensive PyObject_CallObject(o,a)
-- replace then with slightly faster PyObject_Call(o,a,NULL). (The
difference is that the latter requires a to be a tuple; the former
allows other values and wraps them in a tuple if necessary; it
involves two more levels of C function calls to accomplish all that.)
/external/python/cpython2/Objects/typeobject.c
8e829200b1ac79750224563331032de031b76288 16-Aug-2002 Guido van Rossum <guido@python.org> Fix SF bug 595838 -- buffer in type_new() should not be static. Moved
to inner scope, too.
/external/python/cpython2/Objects/typeobject.c
323a9cfc8384adca677923cf3c65ad62920c76fa 14-Aug-2002 Guido van Rossum <guido@python.org> PyType_Ready(): initialize the base class a bit earlier, so that if we
copy the metatype from the base, the base actually has one!
/external/python/cpython2/Objects/typeobject.c
5dc2a37f0f42db96b30c35d273e1ea09e479e478 14-Aug-2002 Neal Norwitz <nnorwitz@gmail.com> Allow more docstrings to be removed during compilation
/external/python/cpython2/Objects/typeobject.c
d47714a727928d754f8eded9546b3b294dadf225 13-Aug-2002 Neal Norwitz <nnorwitz@gmail.com> Allow docstrings to be removed during compilation for *SLOT macro and friends
/external/python/cpython2/Objects/typeobject.c
858e34f6499ede1c2ab6e1f188449e2c13ef5407 13-Aug-2002 Neal Norwitz <nnorwitz@gmail.com> Allow docstrings to be removed during compilation
/external/python/cpython2/Objects/typeobject.c
3747a0f04c1dbe5abb47ce80abea39ed02c01aa2 12-Aug-2002 Guido van Rossum <guido@python.org> Fix MSVC warnings.
/external/python/cpython2/Objects/typeobject.c
ad47da072a436751c0cfd95a21eccea1c39b35f1 12-Aug-2002 Guido van Rossum <guido@python.org> Refactor how __dict__ and __weakref__ interact with __slots__.

1. You can now have __dict__ and/or __weakref__ in your __slots__
(before only __weakref__ was supported). This is treated
differently than before: it merely sets a flag that the object
should support the corresponding magic.

2. Dynamic types now always have descriptors __dict__ and __weakref__
thrust upon them. If the type in fact does not support one or the
other, that descriptor's __get__ method will raise AttributeError.

3. (This is the reason for all this; it fixes SF bug 575229, reported
by Cesar Douady.) Given this code:
class A(object): __slots__ = []
class B(object): pass
class C(A, B): __slots__ = []
the class object for C was broken; its size was less than that of
B, and some descriptors on B could cause a segfault. C now
correctly inherits __weakrefs__ and __dict__ from B, even though A
is the "primary" base (C.__base__ is A).

4. Some code cleanup, and a few comments added.
/external/python/cpython2/Objects/typeobject.c
40af889081938c1fea83cba0a9cbdb35e299119d 10-Aug-2002 Guido van Rossum <guido@python.org> Disallow class assignment completely unless both old and new are heap
types. This prevents nonsense like 2.__class__ = bool or
True.__class__ = int.
/external/python/cpython2/Objects/typeobject.c
721f62e20059d36ae343993615aeecc1805b54fb 09-Aug-2002 Guido van Rossum <guido@python.org> Major speedup for new-style class creation. Turns out there was some
trampolining going on with the tp_new descriptor, where the inherited
PyType_GenericNew was overwritten with the much slower slot_tp_new
which would end up calling tp_new_wrapper which would eventually call
PyType_GenericNew. Add a special case for this to update_one_slot().

XXX Hope there isn't a loophole in this. I'll buy the first person to
point out a bug in the reasoning a beer.

Backport candidate (but I won't do it).
/external/python/cpython2/Objects/typeobject.c
7bed213224508a5f33ed6d88b48017eea803f499 08-Aug-2002 Guido van Rossum <guido@python.org> Significant speedup in new-style object creation: in slot_tp_new(),
intern the string "__new__" so we can call PyObject_GetAttr() rather
than PyObject_GetAttrString(). (Though it's a mystery why slot_tp_new
is being called when a class doesn't define __new__. I'll look into
that tomorrow.)

2.2 backport candidate (but I won't do it).
/external/python/cpython2/Objects/typeobject.c
febd61dc02f0edbe9aa746fabde8ce97fbbeabdb 08-Aug-2002 Guido van Rossum <guido@python.org> A modest speedup of object deallocation. call_finalizer() did rather
a lot of work: it had to save and restore the current exception around
a call to lookup_maybe(), because that could fail in rare cases, and
most objects don't have a __del__ method, so the whole exercise was
usually a waste of time. Changed this to cache the __del__ method in
the type object just like all other special methods, in a new slot
tp_del. So now subtype_dealloc() can test whether tp_del is NULL and
skip the whole exercise if it is. The new slot doesn't need a new
flag bit: subtype_dealloc() is only called if the type was dynamically
allocated by type_new(), so it's guaranteed to have all current slots.
Types defined in C cannot fill in tp_del with a function of their own,
so there's no corresponding "wrapper". (That functionality is already
available through tp_dealloc.)
/external/python/cpython2/Objects/typeobject.c
0906e074426fc596cffb157e28be4bf82de62c7b 07-Aug-2002 Guido van Rossum <guido@python.org> Fix a subtle bug in the trashcan code I added yesterday to
subtype_dealloc().

When call_finalizer() failed, it would return without going through
the trashcan end macro, thereby unbalancing the trashcan nesting level
counter, and thereby defeating the test case (slottrash() in
test_descr.py). This in turn meant that the assert in the GC_UNTRACK
macro wasn't triggered by the slottrash() test despite a bug in the
code: _PyTrash_destroy_chain() calls the dealloc routine with an
object that's untracked, and the assert in the GC_UNTRACK macro would
fail on this; but because of an earlier test that resurrects an
object, causing call_finalizer() to fail and the trashcan nesting
level to be unbalanced, so _PyTrash_destroy_chain() was never called.
Calling the slottrash() test in isolation *did* trigger the assert,
however.

So the fix is twofold: (1) call the GC_UnTrack() function instead of
the GC_UNTRACK macro, because the function is safe when the object is
already untracked; (2) when call_finalizer() fails, jump to a label
that exits through the trashcan end macro, keeping the trashcan
nesting balanced.
/external/python/cpython2/Objects/typeobject.c
22b1387c51a979a6921c18c6e3f7126d24b85e7c 06-Aug-2002 Guido van Rossum <guido@python.org> Fix SF bug 574207 (chained __slots__ dealloc segfault).

This is inspired by SF patch 581742 (by Jonathan Hogg, who also
submitted the bug report, and two other suggested patches), but
separates the non-GC case from the GC case to avoid testing for GC
several times.

Had to fix an assert() from call_finalizer() that asserted that the
object wasn't untracked, because it's possible that the object isn't
GC'ed!
/external/python/cpython2/Objects/typeobject.c
0dbab4c560c944956e4b732fe33ba0d72a8fb6df 01-Aug-2002 Guido van Rossum <guido@python.org> SF patch 588728 (Nathan Srebro).

The __delete__ method wrapper for descriptors was not supported

(I added a test, too.)

2.2 bugfix candidate.
/external/python/cpython2/Objects/typeobject.c
cee5ca060bc1e8870fdadf1ef719761fe2dc500d 30-Jul-2002 Neal Norwitz <nnorwitz@gmail.com> SF patch #587889, fix memory leak of tp_doc
/external/python/cpython2/Objects/typeobject.c
73a088e3fafbfc8b925163a3b0aa626830d26aa0 25-Jul-2002 Jeremy Hylton <jeremy@alum.mit.edu> Don't be so hasty. If PyInt_AsLong() raises an error, don't set ValueError.
/external/python/cpython2/Objects/typeobject.c
f20fcf9fedfbd4d69e4197c78f0b652c4938f761 25-Jul-2002 Jeremy Hylton <jeremy@alum.mit.edu> Complain if __len__() returns < 0, just like classic classes.

Fixes SF bug #575773.

Bug fix candidate.
/external/python/cpython2/Objects/typeobject.c
938ace69a0e112424a2f426a4881d1fd1fc922d2 17-Jul-2002 Jeremy Hylton <jeremy@alum.mit.edu> staticforward bites the dust.

The staticforward define was needed to support certain broken C
compilers (notably SCO ODT 3.0, perhaps early AIX as well) botched the
static keyword when it was used with a forward declaration of a static
initialized structure. Standard C allows the forward declaration with
static, and we've decided to stop catering to broken C compilers. (In
fact, we expect that the compilers are all fixed eight years later.)

I'm leaving staticforward and statichere defined in object.h as
static. This is only for backwards compatibility with C extensions
that might still use it.

XXX I haven't updated the documentation.
/external/python/cpython2/Objects/typeobject.c
719841e2fbf9ca6320aa9515fe054cf4887dab64 16-Jul-2002 Jeremy Hylton <jeremy@alum.mit.edu> The object returned by tp_new() may not have a tp_init.

If the object is an ExtensionClass, for example, the slot is not even
defined. So we must check that the type has the slot (implied by
HAVE_CLASS) before calling tp_init().
/external/python/cpython2/Objects/typeobject.c
03013a0130285c21bb940c89f0538f8ed1d35622 16-Jul-2002 Guido van Rossum <guido@python.org> valid_identifier(): use an unsigned char* so that isalpha() will do
the right thing even if char is unsigned.
/external/python/cpython2/Objects/typeobject.c
3459251d5a2b9589e03e818effc357e5e60ee4a9 11-Jul-2002 Tim Peters <tim.peters@gmail.com> object.h special-build macro minefield: renamed all the new lexical
helper macros to something saner, and used them appropriately in other
files too, to reduce #ifdef blocks.

classobject.c, instance_dealloc(): One of my worst Python Memories is
trying to fix this routine a few years ago when COUNT_ALLOCS was defined
but Py_TRACE_REFS wasn't. The special-build code here is way too
complicated. Now it's much simpler. Difference: in a Py_TRACE_REFS
build, the instance is no longer in the doubly-linked list of live
objects while its __del__ method is executing, and that may be visible
via sys.getobjects() called from a __del__ method. Tough -- the object
is presumed dead while its __del__ is executing anyway, and not calling
_Py_NewReference() at the start allows enormous code simplification.

typeobject.c, call_finalizer(): The special-build instance_dealloc()
pain apparently spread to here too via cut-'n-paste, and this is much
simpler now too. In addition, I didn't understand why this routine
was calling _PyObject_GC_TRACK() after a resurrection, since there's no
plausible way _PyObject_GC_UNTRACK() could have been called on the
object by this point. I suspect it was left over from pasting the
instance_delloc() code. Instead asserted that the object is still
tracked. Caution: I suspect we don't have a test that actually
exercises the subtype_dealloc() __del__-resurrected-me code.
/external/python/cpython2/Objects/typeobject.c
ab5dae35ca5d64cf08c2a48105af4f92dd53b27d 24-Jun-2002 Raymond Hettinger <python@rcn.com> Fix SF bug 572567: Memory leak in object comparison.
/external/python/cpython2/Objects/typeobject.c
0ae0c076615934ed237b412464b49b58c60c0644 21-Jun-2002 Raymond Hettinger <python@rcn.com> SF 569257 -- Name mangle double underscored variable names in __slots__.
/external/python/cpython2/Objects/typeobject.c
63517577fdcd7c17072e1a612f6d91a35030d571 18-Jun-2002 Guido van Rossum <guido@python.org> Patch from SF bug 570483 (Tim Northover).

In a fresh interpreter, type.mro(tuple) would segfault, because
PyType_Ready() isn't called for tuple yet. To fix, call
PyType_Ready(type) if type->tp_dict is NULL.
/external/python/cpython2/Objects/typeobject.c
59e6c539207346398f02820ed1d80e3245112179 14-Jun-2002 Guido van Rossum <guido@python.org> Inexplicably, recurse_down_subclasses() was comparing the object
gotten from a weak reference to NULL instead of to None. This caused
the following assert() to fail (but only in 2.2 in the debug build --
I have to find a better test case). Will backport.
/external/python/cpython2/Objects/typeobject.c
14f8b4cfcb98de74b9c6e9316539be9e2a5cd31f 13-Jun-2002 Martin v. Löwis <martin@v.loewis.de> Patch #568124: Add doc string macros.
/external/python/cpython2/Objects/typeobject.c
09638c16d842c77c7b9f7c0f339508c0b2a40feb 13-Jun-2002 Guido van Rossum <guido@python.org> Hopefully this addresses the remaining issues of SF bugs 459235 and
473985. Through a subtle rearrangement of some members in the etype
struct (!), mapping methods are now preferred over sequence methods,
which is necessary to support str.__getitem__("hello", slice(4)) etc.
/external/python/cpython2/Objects/typeobject.c
cab05807fc89390ce48388442843361c3f2f7a86 10-Jun-2002 Guido van Rossum <guido@python.org> Undo the last chunk of the previous patch, putting back a useful
assert into PyType_Ready(): now that we're not clearing tp_dict, we
can assert that it's non-NULL again.
/external/python/cpython2/Objects/typeobject.c
a386209754139c13a2a72c53c688172371756a2a 10-Jun-2002 Guido van Rossum <guido@python.org> In the recent python-dev thread "Bizarre new test failure", we
discovered that subtype_traverse must traverse the type if it is a
heap type, because otherwise some cycles involving a type and its
instance would not be collected. Simplest example:
while 1:
class C(object): pass
C.ref = C()
This program grows without bounds before this fix. (It grows ever
slower since it spends ever more time in the collector.)

Simply adding the right visit() call to subtype_traverse() revealed
other problems. With MvL's help we re-learned that type_clear()
doesn't have to clear *all* references, only the ones that may not be
cleared by other means. Careful analysis (see comments in the code)
revealed that only tp_mro needs to be cleared. (The previous checkin
to this file adds a test for tp_mro==NULL to _PyType_Lookup() that's
essential to prevent crashes due to tp_mro being NULL when
subtype_dealloc() tries to look for a __del__ method.) The same kind
of analysis also revealed that subtype_clear() doesn't need to clear
the instance dict.

With this fix, a useful property of the collector is once again
guaranteed: a single gc.collect() call will clear out all garbage.
(It didn't always before, which put us on the track of this bug.)

Will backport to 2.2.
/external/python/cpython2/Objects/typeobject.c
2309498595cb5a69547ad87a66b4574971684ec3 10-Jun-2002 Guido van Rossum <guido@python.org> Three's a charm: yet another fix for SF bug 551412. Thinking again
about the test case, slot_nb_power gets called on behalf of its second
argument, but with a non-None modulus it wouldn't check this, and
believes it is called on behalf of its first argument. Fix this
properly, and get rid of the code in _PyType_Lookup() that tries to
call _PyType_Ready(). But do leave a check for a NULL tp_mro there,
because this can still legitimately occur.

I'll fix this in 2.2.x too.
/external/python/cpython2/Objects/typeobject.c
9923ffe2c0f96b1b79f2f5ae39b64b55e038c566 04-Jun-2002 Guido van Rossum <guido@python.org> Address SF bug 519621: slots weren't traversed by GC.

While I was at it, I added a tp_clear handler and changed the
tp_dealloc handler to use the clear_slots helper for the tp_clear
handler.

Also tightened the rules for slot names: they must now be proper
identifiers (ignoring the dirty little fact that <ctype.h> is locale
sensitive).

Also set mp->flags = READONLY for the __weakref__ pseudo-slot.

Most of this is a 2.2 bugfix candidate; I'll apply it there myself.
/external/python/cpython2/Objects/typeobject.c
b65c65b301203b2acb0b8e1b2f45d8b5079ce5fd 03-Jun-2002 Guido van Rossum <guido@python.org> Address the residual issue with the fix for SF 551412 in
_PyType_Lookup(). Decided to clear the error condition in the
unfortunate but unlikely case that PyType_Ready() fails.

Will fix in 2.2.x too.
/external/python/cpython2/Objects/typeobject.c
9fc8a29663268a3ed5b8db15c4b7b7786f80e13e 24-May-2002 Guido van Rossum <guido@python.org> Fix for SF bug 551412. When _PyType_Lookup() is called on a type
whose tp_mro hasn't been initialized, it would dump core. Fix this by
checking for NULL and calling PyType_Ready(). Will fix this in 2.2.1
too.
/external/python/cpython2/Objects/typeobject.c
9ee4b94f51d19a37db3b93222b5e15c8379db78d 24-May-2002 Guido van Rossum <guido@python.org> Add a safeguard against setting the class to something with a
different free or alloc slot.
/external/python/cpython2/Objects/typeobject.c
2b858971899ae0572f0610e4a8d59241471c6771 18-Apr-2002 Tim Peters <tim.peters@gmail.com> type_get_doc(): Squash compiler wng about incompatible ptr types.
/external/python/cpython2/Objects/typeobject.c
6ca7d41c1f0f2f6ef654f3ff6241c80cccf06ab3 18-Apr-2002 Guido van Rossum <guido@python.org> SF bug 542984.

Change type_get_doc (the get function for __doc__) to look in tp_dict
more often, and if it finds a descriptor in tp_dict, to call it (with
a NULL instance). This means you can add a __doc__ descriptor to a
new-style class that returns instance docs when called on an instance,
and class docs when called on a class -- or the same docs in either
case, but lazily computed.

I'll also check this into the 2.2 maintenance branch.
/external/python/cpython2/Objects/typeobject.c
b6b8942f5302e76178833dc33596b892fef8f85f 15-Apr-2002 Guido van Rossum <guido@python.org> SF bug #541883 (Vincent Fiack).

A stupid bug in object_set_class(): didn't check for value==NULL
before checking its type.

Bugfix candidate.
/external/python/cpython2/Objects/typeobject.c
09a2ae58824d80ef69d4a2774d61bd6bd6da224e 12-Apr-2002 Neil Schemenauer <nascheme@enme.ucalgary.ca> Change signature of _PyObject_GC_Malloc to match PyObject_MALLOC.
PyObject_Del and PyObject_GC_Del can now be used as a function
designators.
/external/python/cpython2/Objects/typeobject.c
0986d8250f7ae4019c3e5b5c934dc0fd55f2b8de 08-Apr-2002 Guido van Rossum <guido@python.org> - A type can now inherit its metatype from its base type. Previously,
when PyType_Ready() was called, if ob_type was found to be NULL, it
was always set to &PyType_Type; now it is set to base->ob_type,
where base is tp_base, defaulting to &PyObject_Type.

- PyType_Ready() accidentally did not inherit tp_is_gc; now it does.

Bugfix candidate.
/external/python/cpython2/Objects/typeobject.c
8ace1ab53a49d90d66e8a03491a272c70ad4eb46 06-Apr-2002 Guido van Rossum <guido@python.org> - Changed new-style class instantiation so that when C's __new__
method returns something that's not a C instance, its __init__ is
not called. [SF bug #537450]
/external/python/cpython2/Objects/typeobject.c
6b8ab74c8aecef19314375c440669b4364a236fe 06-Apr-2002 Guido van Rossum <guido@python.org> Don't inherit tp_new! This is a retraction of half of the previous
checkin. And since that one was, this one is also a:

Bugfix candidate.
/external/python/cpython2/Objects/typeobject.c
cc8fe0407a66acc267b60386e9346f3539e0ffae 05-Apr-2002 Guido van Rossum <guido@python.org> Inherit tp_new and tp_is_gc.

Bugfix candidate.
/external/python/cpython2/Objects/typeobject.c
c334df5727ad9cb4a5de85f69b03808b9856b55c 05-Apr-2002 Guido van Rossum <guido@python.org> A much revised version of SF patch 514662, by Naofumi Honda. This
speeds up __getitem__ and __setitem__ in subclasses of built-in
sequences.

It's much revised because I took the opportunity to refactor the code
somewhat (moving a large section of duplicated code to a helper
function) and added comments to a series of functions.
/external/python/cpython2/Objects/typeobject.c
bfc2e5ee8ec66fb483e595eed16d49b75eb7e482 04-Apr-2002 Guido van Rossum <guido@python.org> Clarifying code rearrangement and comments by David Abrahams. I've
got to admit that I haven't reviewed this carefully, but it looks okay
from 30,000 views, and doesn't break anything. (SF patch 536407.)
/external/python/cpython2/Objects/typeobject.c
d464107ecf7c53b9a447dd649408bb9900e410ae 03-Apr-2002 Guido van Rossum <guido@python.org> Fold some long lines. Delete blank initial line.
/external/python/cpython2/Objects/typeobject.c
155db9aa222e96fcaf2db4d80b414098889a7c5d 02-Apr-2002 Guido van Rossum <guido@python.org> SF patch 537536 by Phillip J. Eby, fix for SF bug 535444, super()
broken w/ classmethods.

Bugfix candidate.
/external/python/cpython2/Objects/typeobject.c
93c1e236671cfe9d18bac3fcdaf64d340c1fa953 31-Mar-2002 Neal Norwitz <nnorwitz@gmail.com> Use METH_VARARGS rather than METH_OLDARGS implicitly (args are ignored)
/external/python/cpython2/Objects/typeobject.c
7bf9715a8b794cb743fdac97a9014102985a3dd3 28-Mar-2002 Fred Drake <fdrake@acm.org> Introduce two new flag bits that can be set in a PyMethodDef method
descriptor, as used for the tp_methods slot of a type. These new flag
bits are both optional, and mutually exclusive. Most methods will not
use either. These flags are used to create special method types which
exist in the same namespace as normal methods without having to use
tedious construction code to insert the new special method objects in
the type's tp_dict after PyType_Ready() has been called.

If METH_CLASS is specified, the method will represent a class method
like that returned by the classmethod() built-in.

If METH_STATIC is specified, the method will represent a static method
like that returned by the staticmethod() built-in.

These flags may not be used in the PyMethodDef table for modules since
these special method types are not meaningful in that case; a
ValueError will be raised if these flags are found in that context.
/external/python/cpython2/Objects/typeobject.c
240083177368a929a4ab15098a94b0a6f71aeeed 17-Mar-2002 Tim Peters <tim.peters@gmail.com> SF patch 530070: pydoc regression, from Martin and Guido.
Change the way __doc__ is handled, to avoid blowing up on non-string
__doc__ values.
/external/python/cpython2/Objects/typeobject.c
0628dcfe1faac4926505f8c4cb1905d7700d1bf1 15-Mar-2002 Guido van Rossum <guido@python.org> "Fix" for SF bug #520644: __slots__ are not pickled.

As promised in my response to the bug report, I'm not really fixing
it; in fact, one could argule over what the proper fix should do.
Instead, I'm adding a little magic that raises TypeError if you try to
pickle an instance of a class that has __slots__ but doesn't define or
override __getstate__. This is done by adding a bozo __getstate__
that always raises TypeError.
/external/python/cpython2/Objects/typeobject.c
dfce3bf908f9f6e8b20d54ca5f724994f6790f8a 10-Mar-2002 Guido van Rossum <guido@python.org> Bugfix candidate.
Adapter from SF patch 528038; fixes SF bug 527816.

The wrapper for __nonzero__ should be wrap_inquiry rather than
wrap_unaryfunc, since the slot returns an int, not a PyObject *.
/external/python/cpython2/Objects/typeobject.c
f9bd6b09e1dabdf85df9a858defaba3a99ad3d66 18-Feb-2002 Martin v. Löwis <martin@v.loewis.de> Allow __doc__ to be of arbitrary type. Patch by James Henstridge,
fixes #504343. 2.2.1 candidate.
/external/python/cpython2/Objects/typeobject.c
f884b749103bad0724e2e4878cd5fe49a41bd7df 17-Dec-2001 Guido van Rossum <guido@python.org> - PyType_Ready(): Initialize the ob_type field to &PyType_Type if it's
NULL, so that you can call PyType_Ready() to initialize a type that
is to be separately compiled with C on Windows.

inherit_special(): Add a long comment explaining that you have to set
tp_new if your base class is PyBaseObject_Type.
/external/python/cpython2/Objects/typeobject.c
e54616cb6fdd9f9fb0d86ddd2cd5c4ffb51771b8 14-Dec-2001 Guido van Rossum <guido@python.org> (Merge into trunk.)

Fix for SF bug #492345. (I could've sworn I checked this in, but
apparently I didn't!)

This code:

class Classic:
pass

class New(Classic):
__metaclass__ = type

attempts to create a new-style class with only classic bases -- but it
doesn't work right. Attempts to fix it so it works caused problems
elsewhere, so I'm now raising a TypeError in this case.
/external/python/cpython2/Objects/typeobject.c
14227b4dd41c1dd6cf2ff5b81ad5197b205080ab 06-Dec-2001 Guido van Rossum <guido@python.org> The previous checkin to clear __slots__ variables did a little bit of
the work each time it found another base class. All the work is
contiguous, so we might as well do it all at once at the end.
/external/python/cpython2/Objects/typeobject.c
33bab01da6e2634231bdaa4f03405f4e5a043d59 05-Dec-2001 Guido van Rossum <guido@python.org> Fix SF bug #489581: __slots__ leak.

It was easier than I thought, assuming that no other things contribute
to the instance size besides slots -- a pretty good bet. With a test
suite, no less!
/external/python/cpython2/Objects/typeobject.c
d331cb550221cbf0a5863968ed272fb2afc90202 05-Dec-2001 Guido van Rossum <guido@python.org> At the PythonLabs meeting someone mentioned it would make Jim really
happy if one could delete the __dict__ attribute of an instance. I
love to make Jim happy, so here goes...

- New-style objects now support deleting their __dict__. This is for
all intents and purposes equivalent to assigning a brand new empty
dictionary, but saves space if the object is not used further.
/external/python/cpython2/Objects/typeobject.c
64b206c19e764d12f61681359544938c45912262 04-Dec-2001 Guido van Rossum <guido@python.org> Fix SF bug #486144: Uninitialized __slot__ vrbl is None.

There's now a new structmember code, T_OBJECT_EX, which is used for
all __slot__ variables (except __weakref__, which has special behavior
anyway). This new code raises AttributeError when the variable is
NULL rather than converting NULL to None.
/external/python/cpython2/Objects/typeobject.c
5b443c6282e8ffd6873005b62c50e56fa149e277 03-Dec-2001 Guido van Rossum <guido@python.org> Address SF patch #480716 as well as related issues.

SF patch #480716 by Greg Chapman fixes the problem that super's
__get__ method always returns an instance of super, even when the
instance whose __get__ method is called is an instance of a subclass
of super.

Other issues fixed:

- super(C, C()).__class__ would return the __class__ attribute of C()
rather than the __class__ attribute of the super object. This is
confusing. To fix this, I decided to change the semantics of super
so that it only applies to code attributes, not to data attributes.
After all, overriding data attributes is not supported anyway.

- While super(C, x) carefully checked that x is an instance of C,
super(C).__get__(x) made no such check, allowing for a loophole.
This is now fixed.
/external/python/cpython2/Objects/typeobject.c
1d5b3f29ffc4a17f88f26c670c1e74290795e6f7 03-Dec-2001 Guido van Rossum <guido@python.org> Fix for SF bug #485678.

slot_tp_descr_set(): When deleting an attribute described by a
descriptor implemented in Python, the descriptor's __del__ method is
called by the slot_tp_descr_set dispatch function. This is bogus --
__del__ already has a different meaning. Renaming this use of __del__
is renamed to __delete__.
/external/python/cpython2/Objects/typeobject.c
a91e9646e0f916498e812de467f8ac50574e22b1 15-Nov-2001 Tim Peters <tim.peters@gmail.com> Changing diapers reminded Guido that he wanted to allow for some measure
of multiple inheritance from a mix of new- and classic-style classes.
This is his patch, plus a start at some test cases from me. Will check
in more, plus a NEWS blurb, later tonight.
/external/python/cpython2/Objects/typeobject.c
a427a2b8d09a756119d424efac85159a0270b503 29-Oct-2001 Tim Peters <tim.peters@gmail.com> Rename "dictionary" (type and constructor) to "dict".
/external/python/cpython2/Objects/typeobject.c
7ad2d1eb8eaf8db634b440ef3c4f5a1b9b654cb5 29-Oct-2001 Guido van Rossum <guido@python.org> Add __del__ callbacks. They are too useful to leave out.

XXX Remaining problems:

- The GC module doesn't know about these; I think it has its reasons
to disallow calling __del__, but for now, __del__ on new-style
objects is called when the GC module discards an object, for better
or for worse.

- The code to call a __del__ handler is really ridiculously
complicated, due to all the different debug #ifdefs. I've copied
this from the similar code in classobject.c, so I'm pretty sure I
did it right, but it's not pretty. :-(

- No tests yet.
/external/python/cpython2/Objects/typeobject.c
afe7a94089dab0fea0694647e91988df29d23c1c 29-Oct-2001 Guido van Rossum <guido@python.org> When overriding __str__ or __repr__, set the tp_print slot to NULL.
/external/python/cpython2/Objects/typeobject.c
3abca127fe1565ec80f6b0a1ae48d65186ad887d 27-Oct-2001 Tim Peters <tim.peters@gmail.com> SF bug #475327: type() produces incorrect error msg

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.
/external/python/cpython2/Objects/typeobject.c
6661be3bedf7ad0da8d33487672a227eb6bee6f1 26-Oct-2001 Guido van Rossum <guido@python.org> Allow assignment to newinstance.__dict__.
/external/python/cpython2/Objects/typeobject.c
c8e5645f15054a87945d5f62dc23c6e49a394db5 22-Oct-2001 Guido van Rossum <guido@python.org> Methods of built-in types now properly check for keyword arguments
(formerly these were silently ignored). The only built-in methods
that take keyword arguments are __call__, __init__ and __new__.
/external/python/cpython2/Objects/typeobject.c
f23473f00834fb56a6f71cf18191261f1d083c8b 22-Oct-2001 Neil Schemenauer <nascheme@enme.ucalgary.ca> Add missing "static" declarations (found by "make smelly").
/external/python/cpython2/Objects/typeobject.c
6d204074cbd72bc671d1bdbb0d462ef3f0e49910 21-Oct-2001 Guido van Rossum <guido@python.org> Big internal change that should have no external effects: unify the
'slotdef' structure typedef and 'struct wrapperbase'. By adding the
wrapper docstrings to the slotdef structure, the slotdefs array can
serve as the data structure that drives add_operators(); the wrapper
descriptor contains a pointer to slotdef structure. This replaces
lots of custom code from add_operators() by a loop over the slotdefs
array, and does away with all the tab_xxx tables.
/external/python/cpython2/Objects/typeobject.c
f76de62f7d48a25d5f67357ae7b2f487904a5fcc 18-Oct-2001 Guido van Rossum <guido@python.org> Fix SF bug #472234: type(obj) calls type->tp_init (Roeland Rengelink)

The fix is a band-aid: type_call() now makes the same exception for a
single-argument call to type() as type_new() was already making.
/external/python/cpython2/Objects/typeobject.c
14a6f8378e3b2a00e0cfd0a3853cddaaf56af727 17-Oct-2001 Guido van Rossum <guido@python.org> Remove a bunch of stuff that's no longer needed now that update_slot()
and fixup_slot_dispatchers() always select the proper slot dispatcher.
This affects slot_sq_item(), slot_tp_getattro(), and
slot_tp_getattr_hook().
/external/python/cpython2/Objects/typeobject.c
caf59043d14254c8c4e47070d844e678487ece43 17-Oct-2001 Guido van Rossum <guido@python.org> slot_sq_item(): ensure that self is an instance of the wrapper's
d_type before calling the wrapped function.

fixup_slot_dispatchers(): fix indentation.
/external/python/cpython2/Objects/typeobject.c
b85a8b7bc79179c97ad1e7f876f885166f855cc8 16-Oct-2001 Guido van Rossum <guido@python.org> Refactored the update_slot() code a bit to be hopefully slightly more
efficient:

- recurse down subclasses only once rather than for each affected
slot;

- short-circuit recursing down subclasses when a subclass has its own
definition of the name that caused the update_slot() calls in the
first place;

- inline collect_ptrs().
/external/python/cpython2/Objects/typeobject.c
687ae00460da9cac04eb1ba8f6f5ab4db25fbfc2 16-Oct-2001 Guido van Rossum <guido@python.org> Get rid of __defined__ and tp_defined -- there's no need to
distinguish __dict__ and __defined__ any more. In the C structure,
tp_cache takes its place -- but this hasn't been implemented yet.
/external/python/cpython2/Objects/typeobject.c
2f3ca6eeb6eeebcfa038cd52aca5fecfa74dbd28 15-Oct-2001 Guido van Rossum <guido@python.org> Completely get rid of __dynamic__ and the corresponding
Py_TPFLAGS_DYNAMICTYPE bit. There is no longer a performance benefit,
and I don't really see the use case any more.
/external/python/cpython2/Objects/typeobject.c
825d875371d091f60d2f47fea8f84d0be01e031b 15-Oct-2001 Guido van Rossum <guido@python.org> Add (void *) casts to solve some problems on HP-UX 11.0, as discussed
on SF bug #467145.
/external/python/cpython2/Objects/typeobject.c
d396b9c9c3315b6020ab53f595be05d939be8732 13-Oct-2001 Guido van Rossum <guido@python.org> Redid the slot computation. The initial slot assignments are now done
using the same algorithm as the slot updates. The slotdefs array is
now sorted by slot offset and has an interned string object corresponding
to the name added to each item. More can be done but I need to commit
this first as a working intermediate stage.
/external/python/cpython2/Objects/typeobject.c
5af588b7f0509b79645bc8652c4af038a4bd82ce 12-Oct-2001 Guido van Rossum <guido@python.org> Now that COPYBUF is a new local macro, add #undef COPYBUF.
/external/python/cpython2/Objects/typeobject.c
fc57ccb98248b4a8f4ba4debdf3791970b136c4d 12-Oct-2001 Tim Peters <tim.peters@gmail.com> SF bug [#470040] ParseTuple t# vs subclasses.
inherit_slots(): tp_as_buffer was getting inherited as if it were a
method pointer, rather than a pointer to a vector of method pointers. As
a result, inheriting from a type that implemented buffer methods was
ineffective, leaving all the tp_as_buffer slots NULL in the subclass.
/external/python/cpython2/Objects/typeobject.c
875eeaa193fd8e02d1a8b6d0d6f2768b55b0fff3 11-Oct-2001 Guido van Rossum <guido@python.org> Another step in the right direction: when a new class's attribute
corresponding to a dispatch slot (e.g. __getitem__ or __add__) is set,
calculate the proper dispatch slot and propagate the change to all
subclasses. Because of multiple inheritance, there's no easy way to
avoid always recursing down the tree of subclasses. Who cares?

(There's more to do, but this works. There's also a test for this now.)
/external/python/cpython2/Objects/typeobject.c
fd38f8e638420defc586df77affd66093758ec43 09-Oct-2001 Guido van Rossum <guido@python.org> The slot definition table entry for mp_getitem had a bogus wrapper
function, which caused test_minidom to fail. Fixed this.
/external/python/cpython2/Objects/typeobject.c
7b9144b2ee0b34a0f4569b0e6277b12d1066c6be 09-Oct-2001 Guido van Rossum <guido@python.org> Halfway checkin. This is still messy, but it's beginning to address
the problem that slots weren't inherited properly. override_slots()
no longer exists; in its place comes fixup_slot_dispatchers() which
does more and different work and is table-based. (Eventually I want
this table also to replace all the little tab_foo tables.)

Also add a wrapper for __delslice__; this required a change in
test_descrtut.py.
/external/python/cpython2/Objects/typeobject.c
0eb2a6e974d6862ce5d691f30ec9cc9dae5c9074 09-Oct-2001 Guido van Rossum <guido@python.org> It turned out not so difficult to support old-style numbers (those
without the Py_TPFLAGS_CHECKTYPES flag) in the wrappers. This
required a few changes in test_descr.py to cope with the fact that the
complex type has __int__, __long__ and __float__ methods that always
raise an exception.
/external/python/cpython2/Objects/typeobject.c
44383384b325aa9a492df52393f6cfdde9d9d8a2 08-Oct-2001 Tim Peters <tim.peters@gmail.com> type_subclasses(): debug build was broken due to typo in new assert().
/external/python/cpython2/Objects/typeobject.c
1c45073aba8f4097b4dc74d4fd3b2f5ed5e5ea9b 08-Oct-2001 Guido van Rossum <guido@python.org> Keep track of a type's subclasses (subtypes), in tp_subclasses, which
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.
/external/python/cpython2/Objects/typeobject.c
f2a67daca2206bab783abba99d428e5eaf36a8f7 07-Oct-2001 Tim Peters <tim.peters@gmail.com> Guido suggests, and I agree, to insist that SIZEOF_VOID_P be a power of 2.
This simplifies the rounding in _PyObject_VAR_SIZE, allows to restore the
pre-rounding calling sequence, and allows some nice little simplifications
in its callers. I'm still making it return a size_t, though.
/external/python/cpython2/Objects/typeobject.c
6d483d3477c37d7dfe3113ef6fd02ba02c78fde6 06-Oct-2001 Tim Peters <tim.peters@gmail.com> _PyObject_VAR_SIZE: always round up to a multiple-of-pointer-size value.
As Guido suggested, this makes the new subclassing code substantially
simpler. But the mechanics of doing it w/ C macro semantics are a mess,
and _PyObject_VAR_SIZE has a new calling sequence now.

Question: The PyObject_NEW_VAR macro appears to be part of the public API.
Regardless of what it expands to, the notion that it has to round up the
memory it allocates is new, and extensions containing the old
PyObject_NEW_VAR macro expansion (which was embedded in the
PyObject_NEW_VAR expansion) won't do this rounding. But the rounding
isn't actually *needed* except for new-style instances with dict pointers
after a variable-length blob of embedded data. So my guess is that we do
not need to bump the API version for this (as the rounding isn't needed
for anything an extension can do unless it's recompiled anyway). What's
your guess?
/external/python/cpython2/Objects/typeobject.c
406fe3b1c029e2526f4aeab070cc93177512f164 06-Oct-2001 Tim Peters <tim.peters@gmail.com> Repaired the debug Windows deaths in test_descr, by allocating enough
pad memory to properly align the __dict__ pointer in all cases.

gcmodule.c/objimpl.h, _PyObject_GC_Malloc:
+ Added a "padding" argument so that this flavor of malloc can allocate
enough bytes for alignment padding (it can't know this is needed, but
its callers do).

typeobject.c, PyType_GenericAlloc:
+ Allocated enough bytes to align the __dict__ pointer.
+ Sped and simplified the round-up-to-PTRSIZE logic.
+ Added blank lines so I could parse the if/else blocks <0.7 wink>.
/external/python/cpython2/Objects/typeobject.c
9475a2310d9cdec4b4c36dee8bf30c72605ae928 05-Oct-2001 Guido van Rossum <guido@python.org> Enable GC for new-style instances. This touches lots of files, since
many types were subclassable but had a xxx_dealloc function that
called PyObject_DEL(self) directly instead of deferring to
self->ob_type->tp_free(self). It is permissible to set tp_free in the
type object directly to _PyObject_Del, for non-GC types, or to
_PyObject_GC_Del, for GC types. Still, PyObject_DEL was a tad faster,
so I'm fearing that our pystone rating is going down again. I'm not
sure if doing something like

void xxx_dealloc(PyObject *self)
{
if (PyXxxCheckExact(self))
PyObject_DEL(self);
else
self->ob_type->tp_free(self);
}

is any faster than always calling the else branch, so I haven't
attempted that -- however those types whose own dealloc is fancier
(int, float, unicode) do use this pattern.
/external/python/cpython2/Objects/typeobject.c
50fda3ba267fe8c063ce83b832f349857ca7fdc3 04-Oct-2001 Guido van Rossum <guido@python.org> Make new classes dynamic by default.
/external/python/cpython2/Objects/typeobject.c
59f809d3bc333ec0a4d21ad8d375782e0b25c17e 04-Oct-2001 Tim Peters <tim.peters@gmail.com> type_new(): cast PyObject_MALLOC's result to char*, for clarity.
/external/python/cpython2/Objects/typeobject.c
2f93e28a19e3f250e8c19f9f4334cfa76f5e3645 04-Oct-2001 Tim Peters <tim.peters@gmail.com> SF bug [#467331] ClassType.__doc__ always None.
For a dynamically constructed type object, fill in the tp_doc slot with
a copy of the argument dict's "__doc__" value, provided the latter exists
and is a string.
NOTE: I don't know what to do if it's a Unicode string, so in that case
tp_doc is left NULL (which shows up as Py_None if you do Class.__doc__).
Note that tp_doc holds a char*, not a general PyObject*.
/external/python/cpython2/Objects/typeobject.c
1e1de1cf35ebd6b3cfcc20e40991fa437b8e9864 03-Oct-2001 Guido van Rossum <guido@python.org> typeobject.c, slot_tp_gettattr_hook(): fix the speedup hack -- the
test for getattribute==NULL was bogus because it always found
object.__getattribute__. Pick it apart using the trick we learned
from slot_sq_item, and if it's just a wrapper around
PyObject_GenericGetAttr, zap it. Also added a long XXX comment
explaining the consequences.
/external/python/cpython2/Objects/typeobject.c
f4593e0b657a29f93a74a578cb4d78aafdf384ea 03-Oct-2001 Guido van Rossum <guido@python.org> *EXPERIMENTAL* speedup of slot_sq_item. This sped up the following
test dramatically:

class T(tuple): __dynamic__ = 1
t = T(range(1000))
for i in range(1000): tt = tuple(t)

The speedup was about 5x compared to the previous state of CVS (1.7
vs. 8.8, in arbitrary time units). But it's still more than twice as
slow as as the same test with __dynamic__ = 0 (0.8).

I'm not sure that I really want to go through the trouble of this kind
of speedup for every slot. Even doing it just for the most popular
slots will be a major effort (the new slot_sq_item is 40+ lines, while
the old one was one line with a powerful macro -- unfortunately the
speedup comes from expanding the macro and doing things in a way
specific to the slot signature).

An alternative that I'm currently considering is sketched in PLAN.txt:
trap setattr on type objects. But this will require keeping track of
all derived types using weak references.
/external/python/cpython2/Objects/typeobject.c
da21c0110b1948d4b3e0593e06436a2a5582f366 03-Oct-2001 Guido van Rossum <guido@python.org> call_method(), call_maybe(): fix a performance bug: the argument
pointing to a static variable to hold the object form of the string
was never used, causing endless calls to PyString_InternFromString().
One particular test (with lots of __getitem__ calls) became a third
faster with this!
/external/python/cpython2/Objects/typeobject.c
048eb75c2dca8bf6d483b290c901a53510c9b78a 02-Oct-2001 Guido van Rossum <guido@python.org> Add Garbage Collection support to new-style classes (not yet to their
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.)
/external/python/cpython2/Objects/typeobject.c
55f2099b2f31cfab6c881989f60552c3621ce752 01-Oct-2001 Guido van Rossum <guido@python.org> Miscellaneous code fiddling:

- SLOT1BINFULL() macro: changed this to check for __rop__ overriding
__op__, like binary_op1() in abstract.c -- the latter only calls the
slot function once if both types use the same slot function, so the
slot function must make both calls -- which it already did for the
__op__, __rop__ order, but not yet for the __rop__, __op__ order
when B.__class__ is a subclass of A.__class__.

- slot_sq_contains(), slot_nb_nonzero(): use lookup_maybe() rather
than lookup_method() which sets an exception which we then clear.

- slot_nb_coerce(): don't give up when left argument's __coerce__
returns NotImplemented, but give the right argument a chance.
/external/python/cpython2/Objects/typeobject.c
261116234504e5a250fcb3df704b3438ebc46531 01-Oct-2001 Guido van Rossum <guido@python.org> slot_sq_length(): squash a leak.
/external/python/cpython2/Objects/typeobject.c
25d1807d23fb89213664274c2dada83fd12dee7d 01-Oct-2001 Guido van Rossum <guido@python.org> slot_tp_new(): newargs was leaking.
/external/python/cpython2/Objects/typeobject.c
d016e45fdb21691def79d00b41e20bd64adbc85a 01-Oct-2001 Guido van Rossum <guido@python.org> Fix typo found by doerwalter.
/external/python/cpython2/Objects/typeobject.c
8b13b3ede270bf6f7bf3427675e335ab0bd0f75b 30-Sep-2001 Tim Peters <tim.peters@gmail.com> SF bug [#466173] unpack TypeError unclear
Replaced 3 instances of "iter() of non-sequence" with
"iteration over non-sequence".
Restored "unpack non-sequence" for stuff like "a, b = 1".
/external/python/cpython2/Objects/typeobject.c
9bea3abf0d7c658a95a92a295c82d5bf0b583f08 29-Sep-2001 Guido van Rossum <guido@python.org> Ouch. The wrapper for __rpow__ was the same as for __pow__, resulting
in bizarre outcomes. Test forthcoming.
/external/python/cpython2/Objects/typeobject.c
2ed6bf87c9ce5d2e8a0eb33f7aa6503196205a0c 27-Sep-2001 Guido van Rossum <guido@python.org> Merge branch changes (coercion, rich comparisons) into trunk.
/external/python/cpython2/Objects/typeobject.c
874f15aa289e30e32a74379749cf9b6bea674fde 25-Sep-2001 Guido van Rossum <guido@python.org> add_operators(): the __floordiv__ and __truediv__ descriptors (and
their 'i' and 'r' variants) were not being generated if the
corresponding nb_ slots were present in the type object. I bet this
is because floor and true division were introduced after I last
looked at that part of the code.
/external/python/cpython2/Objects/typeobject.c
3926a63d0579bbeea6ab855a31dc38b9fa56b5e3 25-Sep-2001 Guido van Rossum <guido@python.org> - Provisional support for pickling new-style objects. (*)

- Made cls.__module__ writable.

- Ensure that obj.__dict__ is returned as {}, not None, even upon first
reference; it simply springs into life when you ask for it.

(*) The pickling support is provisional for the following reasons:

- It doesn't support classes with __slots__.

- It relies on additional support in copy_reg.py: the C method
__reduce__, defined in the object class, really calls calling
copy_reg._reduce(obj). Eventually the Python code in copy_reg.py
needs to be migrated to C, but I'd like to experiment with the
Python implementation first. The _reduce() code also relies on an
additional helper function, _reconstructor(), defined in
copy_reg.py; this should also be reimplemented in C.
/external/python/cpython2/Objects/typeobject.c
a4cb78874ce31bef1a4c05bd5bace387bc5bb677 25-Sep-2001 Guido van Rossum <guido@python.org> Change repr() of a new-style class to say <class 'ClassName'> rather
than <type 'ClassName'>. Exception: if it's a built-in type or an
extension type, continue to call it <type 'ClassName>. Call me a
wimp, but I don't want to break more user code than necessary.
/external/python/cpython2/Objects/typeobject.c
5c294fb0e634afc4807ca83032ace356512c97dc 25-Sep-2001 Guido van Rossum <guido@python.org> Make __class__ assignment possible, when the object structures are the
same. I hope the test for structural equivalence is stringent enough.
It only allows the assignment if the old and new types:

- have the same basic size
- have the same item size
- have the same dict offset
- have the same weaklist offset
- have the same GC flag bit
- have a common base that is the same except for maybe the dict and
weaklist (which may have been added separately at the same offsets
in both types)
/external/python/cpython2/Objects/typeobject.c
3d45d8f12ea3b4180ed2e1539aa28e14a150b5ba 24-Sep-2001 Guido van Rossum <guido@python.org> Another comparison patch-up: comparing a type with a dynamic metatype
to one with a static metatype raised an obscure error.
/external/python/cpython2/Objects/typeobject.c
ff0e6d6ef542b5b4f3c31786aa152cec68598d4f 24-Sep-2001 Guido van Rossum <guido@python.org> Fix the baffler that Tim reported: sometimes the repr() of an object
looks like <X object at ...>, sometimes it says <X instance at ...>.
Make this uniformly say <X object at ...>.
/external/python/cpython2/Objects/typeobject.c
19c1cd5b352e503c4585398d2533e5ae3bf4c189 21-Sep-2001 Guido van Rossum <guido@python.org> Add the __getattr__ hook back. The rules are now:
- if __getattribute__ exists, it is called first;
if it doesn't exists, PyObject_GenericGetAttr is called first.
- if the above raises AttributeError, and __getattr__ exists,
it is called.
/external/python/cpython2/Objects/typeobject.c
867a8d2e2688d837c67bf87eb9164528780f7bdc 21-Sep-2001 Guido van Rossum <guido@python.org> Change the name of the __getattr__ special method for new-style
classes to __getattribute__, to make it crystal-clear that it doesn't
have the same semantics as overriding __getattr__ on classic classes.

This is a halfway checkin -- I'll proceed to add a __getattr__ hook
that works the way it works in classic classes.
/external/python/cpython2/Objects/typeobject.c
32d34c809f5971f79462dcb7d0f536d46e624acc 20-Sep-2001 Guido van Rossum <guido@python.org> Add optional docstrings to getset descriptors. Fortunately, there's
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.
/external/python/cpython2/Objects/typeobject.c
6f7993765ac0989b5d13084240797913627a31d8 20-Sep-2001 Guido van Rossum <guido@python.org> Add optional docstrings to member descriptors. For backwards
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.
/external/python/cpython2/Objects/typeobject.c
ab3b0343b89b4683148dadaf89728ee1198ebee5 18-Sep-2001 Guido van Rossum <guido@python.org> Hopefully fix 3-way comparisons. This unfortunately adds yet another
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.
/external/python/cpython2/Objects/typeobject.c
ceccae5365276f3b8858deb3f49815ff8e8f0b8c 18-Sep-2001 Guido van Rossum <guido@python.org> wrap_cmpfunc(): added a safety check for the __cmp__ wrapper. We can
only safely call a type's tp_compare slot if the second argument is
also an instance of the same type. I hate to think what
e.g. int_compare() would do with a second argument that's a float!
/external/python/cpython2/Objects/typeobject.c
26f68f5957cd4ac0f5942285f040ad60df4ef555 18-Sep-2001 Tim Peters <tim.peters@gmail.com> type_new(): Didn't compile anymore, due to change in struct memberlist
definition. Guido, what else did you forget to check in <wink>?
/external/python/cpython2/Objects/typeobject.c
a8c60f478cfadf9d75d605816f3962fbe588640a 14-Sep-2001 Guido van Rossum <guido@python.org> tp_new_wrapper(): A subtle change in the check for safe use.
Allow staticbase != type, as long as their tp_new slots are the same.
/external/python/cpython2/Objects/typeobject.c
f21c6be7bd41609a4bc11f6a900da01f70be3258 14-Sep-2001 Guido van Rossum <guido@python.org> Add call_maybe(): a variant of call_method() that returns
NotImplemented when the lookup fails, and use this for binary
operators. Also lookup_maybe() which doesn't raise an exception when
the lookup fails (still returning NULL).
/external/python/cpython2/Objects/typeobject.c
717ce00c7cd3198118d2de5ae23601828ae1061a 14-Sep-2001 Guido van Rossum <guido@python.org> call_method():

- Don't turn a non-tuple argument into a one-tuple. Rather, the
caller must pass a format that causes Py_VaBuildValue() to return a
tuple.

- Speed things up by calling PyObject_Call (which is fairly low-level
and straightforward) rather than PyObject_CallObject (which calls
PyEval_CallObjectWithKeywords which calls PyObject_Call, and nothing
is really done in the mean time except some tests for NULL args and
valid types, which are already guaranteed).

- Cosmetics.

Other places:

- Make sure that the format argument to call_method() is surrounded by
parentheses, so it will cause a tuple to be created.

- Replace a few calls to PyEval_CallObject() with a surefire tuple for
args to calls to PyObject_Call(). (A few calls to
PyEval_CallObject() remain that have NULL for args.)
/external/python/cpython2/Objects/typeobject.c
3f996e7266113eed814015d977d50e221c3a421d 13-Sep-2001 Tim Peters <tim.peters@gmail.com> type_call(): Change in policy. The keyword args (if any) are now passed
on to the tp_new slot (if non-NULL), as well as to the tp_init slot (if
any). A sane type implementing both tp_new and tp_init should probably
pay attention to the arguments in only one of them.
/external/python/cpython2/Objects/typeobject.c
16a77adfbd745c202878fabb0b921514fec7ca16 08-Sep-2001 Tim Peters <tim.peters@gmail.com> Generalize operator.indexOf (PySequence_Index) to work with any
iterable object. I'm not sure how that got overlooked before!

Got rid of the internal _PySequence_IterContains, introduced a new
internal _PySequence_IterSearch, and rewrote all the iteration-based
"count of", "index of", and "is the object in it or not?" routines to
just call the new function. I suppose it's slower this way, but the
code duplication was getting depressing.
/external/python/cpython2/Objects/typeobject.c
9478d07ee71161a8098da53b4b902899f36bf6ba 07-Sep-2001 Guido van Rossum <guido@python.org> PyType_IsSubtype(): test tp_flags for HAVE_CLASS bit before accessing
a->tp_mro. If a doesn't have class, it's considered a subclass only
of itself or of 'object'.

This one fix is enough to prevent the ExtensionClass test suite from
dumping core, but that doesn't say much (it's a rather small test
suite). Also note that for ExtensionClass-defined types, a different
subclass test may be needed. But I haven't checked whether
PyType_IsSubtype() is actually used in situations where this matters
-- probably it doesn't, since we also don't check for classic classes.
/external/python/cpython2/Objects/typeobject.c
41eb14dffab5c5b559028f062d209b5cde8224f4 31-Aug-2001 Guido van Rossum <guido@python.org> Give 'super' a decent repr(), and readonly attributes to access the
type and obj properties. The "bogus super object" message is gone --
this will now just raise an AttributeError.
/external/python/cpython2/Objects/typeobject.c
017cb2c7d85fa4a07365a9a205aca21bc29d01a8 30-Aug-2001 Tim Peters <tim.peters@gmail.com> Squash new compiler wng.
/external/python/cpython2/Objects/typeobject.c
6fb3fdec7c3aa9cbda9176f88076e5bee4743834 30-Aug-2001 Guido van Rossum <guido@python.org> Pytype_GenericAlloc(): round up size so we zap all four bytes of the
__dict__ slot for string subtypes.

subtype_dealloc(): properly use _PyObject_GetDictPtr() to get the
(potentially negative) dict offset. Don't copy things into local
variables that are used only once.

type_new(): properly calculate a negative dict offset when tp_itemsize
is nonzero. The __dict__ attribute, if present, is now a calculated
attribute rather than a structure member.
/external/python/cpython2/Objects/typeobject.c
c41418751fcef0a42f336ba91871827b45d558a7 30-Aug-2001 Guido van Rossum <guido@python.org> Safety measures now that str and tuple are subclassable:

If tp_itemsize of the basetype is nonzero, only allow empty __slots__
(declaring that no __dict__ should be added), and don't add a weakref
offset.
/external/python/cpython2/Objects/typeobject.c
31bcff8815f263ab25ac9458f7b45975d8ebecbc 30-Aug-2001 Guido van Rossum <guido@python.org> Make 'super' subclassable. (Not sure how useful this is yet. :-)
/external/python/cpython2/Objects/typeobject.c
c806c8858dcefeccab5b77a85c07627be8e7be28 30-Aug-2001 Neil Schemenauer <nascheme@enme.ucalgary.ca> Use new GC API. Remove usage of BASICSIZE macros.
/external/python/cpython2/Objects/typeobject.c
e705ef1bced126819d7568b1d4e0ac6944b987e0 29-Aug-2001 Guido van Rossum <guido@python.org> Fix super() so that it is usable for static methods (like __new__) as well.
In particular, the second argument can now be a subclass of the first
as well (normally it must be an instance though).
/external/python/cpython2/Objects/typeobject.c
5592e4d7d592a0e9156da7d0e4a290d64e982872 28-Aug-2001 Guido van Rossum <guido@python.org> Fix a typo in SLOT0 macro for the declaration of cache_str.
Dunno why I didn't catch this before.
/external/python/cpython2/Objects/typeobject.c
2730b132024acd7fbb18110a49b1ea1dbe9e2261 28-Aug-2001 Guido van Rossum <guido@python.org> Finish the previous checkin: also avoid getattr when calling the method
directly.
/external/python/cpython2/Objects/typeobject.c
607187325fa364bb170de354f7a12ec60a973ff7 28-Aug-2001 Guido van Rossum <guido@python.org> Change in policy: when a slot_tp_xxx function looks for the __xxx__ method,
don't use getattr, but only look in the dict of the type and base types.
This prevents picking up all sorts of weird stuff, including things defined
by the metaclass when the object is a class (type).

For this purpose, a helper function lookup_method() was added. One or two
other places also use this.
/external/python/cpython2/Objects/typeobject.c
7ce3694a527afe425a2b9df65c049b0ef4e75960 24-Aug-2001 Barry Warsaw <barry@python.org> repr's converted to using PyString_FromFormat() instead of sprintf'ing
into a hardcoded char* buffer.

Closes patch #454743.
/external/python/cpython2/Objects/typeobject.c
705f0f5a91fec6f4edaa2d8fd4faf17d75c4700c 24-Aug-2001 Guido van Rossum <guido@python.org> Add 'super', another new object type with magical properties.

super(type) -> unbound super object
super(type, obj) -> bound super object; requires isinstance(obj, type)

Typical use to call a cooperative superclass method:

class C(B):
def meth(self, arg):
super(C, self).meth(arg);
/external/python/cpython2/Objects/typeobject.c
2c25239215964746e030d9f7e47232d4dca5746d 24-Aug-2001 Guido van Rossum <guido@python.org> slot_tp_descr_get(): guard against NULL obj or type (bug reported by
Thomas Hellor on python-dev).

slot_tp_descr_set(): if value is NULL, call __del__ instead of
__set__.
/external/python/cpython2/Objects/typeobject.c
60f018846d7b97eec71675c3a1c9e7a058232c73 22-Aug-2001 Barry Warsaw <barry@python.org> Merge changes from r22a2-branch back into trunk. Also, change patch
level to 2.2a2+
/external/python/cpython2/Objects/typeobject.c
5d815f323bad407db37b428403df81d1b76018a5 17-Aug-2001 Guido van Rossum <guido@python.org> Address SF bug #442813. The sequence getitem wrappers should do
interpretation of negative indices, since neither the sq_*item slots
nor the slot_ wrappers do this. (Slices are a different story, there
the size wrapping is done too early.)
/external/python/cpython2/Objects/typeobject.c
9676b22cd70ba83b8f03c5d2191892236d9dbd0d 17-Aug-2001 Guido van Rossum <guido@python.org> Weak reference support, closing SF bug #451773.

Classes that don't use __slots__ have a __weakref__ member added in
the same way as __dict__ is added (i.e. only if the base didn't
already have one). Classes using __slots__ can enable weak
referenceability by adding '__weakref__' to the __slots__ list.

Renamed the __weaklistoffset__ class member to __weakrefoffset__ --
it's not always a list, it seems. (Is tp_weaklistoffset a historical
misnomer, or do I misunderstand this?)
/external/python/cpython2/Objects/typeobject.c
1a49350e8d7fdf7c847cc41bc1d3511dd203320d 17-Aug-2001 Guido van Rossum <guido@python.org> type_new(): look for __dynamic__ at the module level (after looking in
the class dict). Anything but a nonnegative int in either place is
*ignored* (before, a non-Boolean was an error). The default is still
static -- in a comparative test, Jeremy's Tools/compiler package ran
twice as slow (compiling itself) using dynamic as the default. (The
static version, which requires a few tweaks to avoid modifying class
variables, runs at about the same speed as the classic version.)

slot_tp_descr_get(): this also needed fallback behavior.

slot_tp_getattro(): remove a debug fprintf() call.
/external/python/cpython2/Objects/typeobject.c
8d32c8b59f9b5f4315f42a48b73a52adea3e10a2 17-Aug-2001 Guido van Rossum <guido@python.org> type_new(): only defer to the winning metatype if it's different from
the metatype passed in as an argument. This prevents infinite
recursion when a metatype written in Python calls type.__new__() as a
"super" call.

Also tweaked some comments.
/external/python/cpython2/Objects/typeobject.c
76e6963fc122fd3ed17794b4f7db6b1f20efeeab 16-Aug-2001 Guido van Rossum <guido@python.org> Fix object_repr() to include the module (using the same rules as
type_repr() for when to show or not to show it).
/external/python/cpython2/Objects/typeobject.c
e3eb1f2b2320bceb10a763ec8691200b85ec287a 16-Aug-2001 Martin v. Löwis <martin@v.loewis.de> Patch #427190: Implement and use METH_NOARGS and METH_O.
/external/python/cpython2/Objects/typeobject.c
c35422109b36d20f409a3a72f60c0c7e2e0bc824 16-Aug-2001 Guido van Rossum <guido@python.org> Fix SF bug #442501: calculate __module__ properly.

- type_module(), type_name(): if tp_name contains one or more period,
the part before the last period is __module__, the part after that
is __name__. Otherwise, for non-heap types, __module__ is
"__builtin__". For heap types, __module__ is looked up in
tp_defined.

- type_new(): heap types have their __module__ set from
globals().__name__; a pre-existing __module__ in their dict is not
overridden. This is not inherited.

- type_repr(): if __module__ exists and is not "__builtin__", it is
included in the string representation (just as it already is for
classes). For example <type '__main__.C'>.
/external/python/cpython2/Objects/typeobject.c
8098ddbe814325c7869f7d63aa102019b353c6b6 16-Aug-2001 Guido van Rossum <guido@python.org> Subtle change to make None.__class__ work:

- descrobject.c:descr_check(): only believe None means the same as
NULL if the type given is None's type.

- typeobject.c:wrap_descr_get(): don't "conventiently" default an
absent type to the type of the object argument. Let the called
function figure it out.
/external/python/cpython2/Objects/typeobject.c
b8f636641fd59656aeb38825cec38e4f208e7500 16-Aug-2001 Guido van Rossum <guido@python.org> - Another big step in the right direction. All the overridable
operators for which a default implementation exist now work, both in
dynamic classes and in static classes, overridden or not. This
affects __repr__, __str__, __hash__, __contains__, __nonzero__,
__cmp__, and the rich comparisons (__lt__ etc.). For dynamic
classes, this meant copying a lot of code from classobject! (XXX
There are still some holes, because the comparison code in object.c
uses PyInstance_Check(), meaning new-style classes don't get the
same dispensation. This needs more thinking.)

- Add object.__hash__, object.__repr__, object.__str__. The __str__
dispatcher now calls the __repr__ dispatcher, as it should.

- For static classes, the tp_compare, tp_richcompare and tp_hash slots
are now inherited together, or not at all. (XXX I fear there are
still some situations where you can inherit __hash__ when you
shouldn't, but mostly it's OK now, and I think there's no way we can
get that 100% right.)
/external/python/cpython2/Objects/typeobject.c
4dd64ab5eae7de3074b9cb94e22e80f43653e232 14-Aug-2001 Guido van Rossum <guido@python.org> Non-function fields, like tp_dictoffset and tp_weaklistoffset, should
be inherited in inherit_special(), otherwise dynamic types don't
inherit these.

Also added some XXX comments about open ends.
/external/python/cpython2/Objects/typeobject.c
8e24818cf4919bb7caff7b12a4d7520865c3f0ce 12-Aug-2001 Guido van Rossum <guido@python.org> Make dynamic types work as intended. Or at least more so.

XXX There are still some loose ends: repr(), str(), hash() and
comparisons don't inherit a default implementation from object. This
must be resolved similarly to the way it's resolved for classic
instances.
/external/python/cpython2/Objects/typeobject.c
8de8680d071df3bddcb5d56a06d11697a32a922e 12-Aug-2001 Guido van Rossum <guido@python.org> Temporary stop-gap fix for dynamic classes, so they pass the test.

XXX This is not sufficient: if a dynamic class has no __repr__ method
(for instance), but later one is added, that doesn't add a tp_repr
slot, so repr() doesn't call the __repr__ method. To make this work,
I'll have to add default implementations of several slots to 'object'.

XXX Also, dynamic types currently only inherit slots from their
dominant base.
/external/python/cpython2/Objects/typeobject.c
13d52f0b3289e34298fbf5d3912cb642f3d2fbd9 10-Aug-2001 Guido van Rossum <guido@python.org> - Big changes to fix SF bug #442833 (a nasty multiple inheritance
problem). inherit_slots() is split in two parts: inherit_special()
which inherits the flags and a few very special members from the
dominant base; inherit_slots() which inherits only regular slots,
and is now called for each base in the MRO in turn. These are now
both void functions since they don't have error returns.

- Added object.__setitem__() back -- for the same reason as
object.__new__(): a subclass of object should be able to call
object.__new__().

- add_wrappers() was moved around to be closer to where it is used (it
was defined together with add_methods() etc., but has nothing to do
with these).
/external/python/cpython2/Objects/typeobject.c
d614f977331a15a34ec9472fecb1880392c5eca6 10-Aug-2001 Guido van Rossum <guido@python.org> Change PyType_Ready() to use the READY and READYING flags. This makes
it possible to detect recursive calls early (as opposed to when the
stack overflows :-).
/external/python/cpython2/Objects/typeobject.c
29687cd2112c540a8a4d31cf3b191cf10db08412 09-Aug-2001 Guido van Rossum <guido@python.org> Sigh. Strengthen the resriction of the previous checkin: tp_new is
inherited unless *both*: (a) the base type is 'object', and (b) the
subtype is not a "heap" type.
/external/python/cpython2/Objects/typeobject.c
c11e192d416e2970e6a06cf06d4cf788f322c6ea 09-Aug-2001 Guido van Rossum <guido@python.org> Thinking back to the 2.22 revision, I didn't like what I did there one
bit. For one, this class:

class C(object):
def __new__(myclass, ...): ...

would have no way to call the __new__ method of its base class, and
the workaround (to create an intermediate base class whose __new__ you
can call) is ugly.

So, I've come up with a better solution that restores object.__new__,
but still solves the original problem, which is that built-in and
extension types shouldn't inherit object.__new__. The solution is
simple: only "heap types" inherit tp_new. Simpler, less code,
perfect!
/external/python/cpython2/Objects/typeobject.c
dc91b99f23610573c275cb70f987bcf56eee0d23 09-Aug-2001 Guido van Rossum <guido@python.org> Proper support for binary operators, including true division and floor
division. The basic binary operators now all correctly call the
__rxxx__ variant when they should.

In type_new(), I now make the new type a new-style number unless it
inherits from an old-style number that has numeric methods.

By way of cosmetics, I've changed the signatures of the SLOT<i> macros
to take actual function names and operator names as strings, rather
than rely on C preprocessor symbol manipulations. This makes the
calls slightly more verbose, but greatly helps simple searches through
the file: you can now find out where "__radd__" is used or where the
function slot_nb_power() is defined and where it is used.
/external/python/cpython2/Objects/typeobject.c
8e938b42570c6118b368c7a14679d85a5c1bd642 08-Aug-2001 Jack Jansen <jack.jansen@cwi.nl> Removed extraneous semicolons that caused a gazzilion "empty declaration" warnings in the MetroWerks compiler.
/external/python/cpython2/Objects/typeobject.c
528b7eb0b0fa5a6bbbf5f3dfbfb7c356edaf031c 07-Aug-2001 Guido van Rossum <guido@python.org> - Rename PyType_InitDict() to PyType_Ready().

- Add an explicit call to PyType_Ready(&PyList_Type) to pythonrun.c
(just for the heck of it, really -- we should either explicitly
ready all types, or none).
/external/python/cpython2/Objects/typeobject.c
f040ede6e8a0ccb37f60798ad1cc48d265b5d2c2 07-Aug-2001 Guido van Rossum <guido@python.org> Cosmetics:

- Add comment blocks explaining add_operators() and override_slots().
(This file could use some more explaining, but this is all I had
breath for today. :)

- Renamed the argument 'base' of add_wrappers() to 'wraps' because
it's not a base class (which is what the 'base' identifier is used
for elsewhere).

Small nits:

- Fix add_tp_new_wrapper() to avoid overwriting an existing __new__
descriptor in tp_defined.

- In add_operators(), check the return value of add_tp_new_wrapper().

Functional change:

- Remove the tp_new functionality from PyBaseObject_Type; this means
you can no longer instantiate the 'object' type. It's only useful
as a base class.

- To make up for the above loss, add tp_new to dynamic types. This
has to be done in a hackish way (after override_slots() has been
called, with an explicit call to add_tp_new_wrapper() at the very
end) because otherwise I ran into recursive calls of slot_tp_new().
Sigh.
/external/python/cpython2/Objects/typeobject.c
0d231eda52dac76dd308f53d14e0dece6285c506 06-Aug-2001 Guido van Rossum <guido@python.org> A totally new way to do the __new__ wrapper. This should address the
problem brought up in SF bug #444229.
/external/python/cpython2/Objects/typeobject.c
2b8d7bdd771b39a7bbddb53f911624c2ef5b0824 02-Aug-2001 Guido van Rossum <guido@python.org> Fix SF #442791 (revisited): No __delitem__ wrapper was defined.
/external/python/cpython2/Objects/typeobject.c
6d6c1a35e08b95a83dbe47dbd9e6474daff00354 02-Aug-2001 Tim Peters <tim.peters@gmail.com> Merge of descr-branch back into trunk.
/external/python/cpython2/Objects/typeobject.c
fcc54cab100108f97c5b5641e3df11b7614993c2 10-Jun-2001 Jack Jansen <jack.jansen@cwi.nl> Added a missing cast to the hashfunc initializer.
/external/python/cpython2/Objects/typeobject.c
0163d6d6ef85dd0cd0ea4ea6dce4b867e39cd6b9 09-Jun-2001 Martin v. Löwis <martin@v.loewis.de> Patch #424475: Speed-up tp_compare usage, by special-casing the common
case of objects with equal types which support tp_compare. Give
type objects a tp_compare function.
Also add c<0 tests before a few PyErr_Occurred tests.
/external/python/cpython2/Objects/typeobject.c
8586991099e4ace18ee94163a96b8ea1bed77ebe 02-Sep-2000 Guido van Rossum <guido@python.org> REMOVED all CWI, CNRI and BeOpen copyright markings.
This should match the situation in the 1.6b1 tree.
/external/python/cpython2/Objects/typeobject.c
45cfbcccc287ae52656737466ca071ca18f603c7 09-Jul-2000 Fred Drake <fdrake@acm.org> ANSI-fication of the sources.
/external/python/cpython2/Objects/typeobject.c
ffcc3813d82e6b96db79f518f4e67b940a13ce64 01-Jul-2000 Guido van Rossum <guido@python.org> Change copyright notice - 2nd try.
/external/python/cpython2/Objects/typeobject.c
fd71b9e9d496caa510dec56a9b69966558d6ba5d 01-Jul-2000 Guido van Rossum <guido@python.org> Change copyright notice.
/external/python/cpython2/Objects/typeobject.c
80c2a1674efdfd95e979172842237509b33a8378 02-Jun-1997 Guido van Rossum <guido@python.org> American spelling in doc string.
/external/python/cpython2/Objects/typeobject.c
c0b618a2ccfb0fc39e07ee96dc09da77fbcce1b1 02-May-1997 Guido van Rossum <guido@python.org> Quickly renamed the last directory.
/external/python/cpython2/Objects/typeobject.c
d266eb460e20ded087d01a29da0a230e235afc40 25-Oct-1996 Guido van Rossum <guido@python.org> New permission notice, includes CNRI.
/external/python/cpython2/Objects/typeobject.c
29ca26eebf85b1919e0dae2e41e066334fbe7e9a 07-Jan-1995 Guido van Rossum <guido@python.org> added getattr(), supporting __doc__ and _name__
/external/python/cpython2/Objects/typeobject.c
6610ad9d6bfe484a026f1fd34ebdcdf9924f9114 04-Jan-1995 Guido van Rossum <guido@python.org> Added 1995 to copyright message.
floatobject.c: fix hash().
methodobject.c: support METH_FREENAME flag bit.
/external/python/cpython2/Objects/typeobject.c
1d5735e84621a7fe68d361fa0e289fa2c3310836 30-Aug-1994 Guido van Rossum <guido@python.org> Merge back to main trunk
/external/python/cpython2/Objects/typeobject.c
9bfef44d97d1ae24e03717e3d59024b44626a9de 29-Mar-1993 Guido van Rossum <guido@python.org> * Changed all copyright messages to include 1993.
* Stubs for faster implementation of local variables (not yet finished)
* Added function name to code object. Print it for code and function
objects. THIS MAKES THE .PYC FILE FORMAT INCOMPATIBLE (the version
number has changed accordingly)
* Print address of self for built-in methods
* New internal functions getattro and setattro (getattr/setattr with
string object arg)
* Replaced "dictobject" with more powerful "mappingobject"
* New per-type functio tp_hash to implement arbitrary object hashing,
and hashobject() to interface to it
* Added built-in functions hash(v) and hasattr(v, 'name')
* classobject: made some functions static that accidentally weren't;
added __hash__ special instance method to implement hash()
* Added proper comparison for built-in methods and functions
/external/python/cpython2/Objects/typeobject.c
7066dd75c5ee8385135541d03fb8edd8939ad740 17-Sep-1992 Guido van Rossum <guido@python.org> * Makefile: added IMGFILE; moved some stuff around.
* flmodule.c: added some missing functions; changed readonly flags of
some data members based upon FORMS documentation.
* listobject.c: fixed int/long arg lint bug (bites PC compilers).
* several: removed redundant print methods (repr is good enough).
* posixmodule.c: added (still experimental) process group functions.
/external/python/cpython2/Objects/typeobject.c
bab9d0385585fcddf6ee96a4ca38dd18e3517f54 05-Apr-1992 Guido van Rossum <guido@python.org> Copyright for 1992 added
/external/python/cpython2/Objects/typeobject.c
96163c1dec1ded2518e6569e7d94cb3a26c00c6b 27-Mar-1992 Guido van Rossum <guido@python.org> Lint...
/external/python/cpython2/Objects/typeobject.c
2fe53f7fec8e2c2a83e1d587633f2765fb829436 01-Jul-1991 Guido van Rossum <guido@python.org> The print operation now returns status!
/external/python/cpython2/Objects/typeobject.c
f70e43a073b36c6f6e9894c01025243a77a452d4 19-Feb-1991 Guido van Rossum <guido@python.org> Added copyright notice.
/external/python/cpython2/Objects/typeobject.c
3f5da24ea304e674a9abbdcffc4d671e32aa70f1 20-Dec-1990 Guido van Rossum <guido@python.org> "Compiling" version
/external/python/cpython2/Objects/typeobject.c
85a5fbbdfea617f6cc8fae82c9e8c2b5c424436d 14-Oct-1990 Guido van Rossum <guido@python.org> Initial revision
/external/python/cpython2/Objects/typeobject.c