summaryrefslogtreecommitdiff
path: root/Include/object.h
Commit message (Collapse)AuthorAgeFilesLines
* Untabify C files. Will watch buildbots.Antoine Pitrou2010-05-091-283/+283
|
* add _PyObject_LookupSpecial to handle fetching special method lookupBenjamin Peterson2009-05-081-0/+1
|
* Issue #1113244: Py_XINCREF, Py_DECREF, Py_XDECREF: Add `do { ... } while (0)'Matthias Klose2009-04-051-2/+2
| | | | to avoid compiler warnings.
* - Py_DECREF: Add `do { ... } while (0)' to avoid compiler warnings.Matthias Klose2009-04-051-5/+7
| | | | (avoiding brown paper typo this time)
* revert r71159 since it broke the buildBenjamin Peterson2009-04-041-7/+5
|
* - Py_DECREF: Add `do { ... } while (0)' to avoid compiler warnings.Matthias Klose2009-04-041-5/+7
|
* Issue #2396: backport the memoryview object.Antoine Pitrou2009-04-021-13/+15
|
* #3720: Interpreter crashes when an evil iterator removes its own next function.Amaury Forgeot d'Arc2009-01-121-0/+1
| | | | | | 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.
* sort of backport 66038 by aliasing PyObject_Bytes to PyObject_StrBenjamin Peterson2008-08-261-0/+1
|
* Hopeful fix for issue 1878: remove Py_TPFLAGS_HAVE_VERSION_TAG fromGuido van Rossum2008-08-191-6/+19
| | | | Py_TPFLAGS_DEFAULT when not building the core.
* Issue #3139: Make buffer-interface thread-safe wrt. PyArg_ParseTuple,Martin v. Löwis2008-08-121-1/+2
| | | | | | | by denying s# to parse objects that have a releasebuffer procedure, and introducing s*. More module might need to get converted to use s*.
* Issue 2235: __hash__ is once again inherited by default, but inheritance can ↵Nick Coghlan2008-07-151-0/+1
| | | | be blocked explicitly so that collections.Hashable remains meaningful
* Issue #3274: Use a less common identifier for the temporary variableAlexandre Vassalotti2008-07-131-2/+2
| | | | in Py_CLEAR().
* Revert 64424, 64438, and 64439.Raymond Hettinger2008-06-241-3/+0
|
* Make bin() implementation parallel oct() and hex() so that int/long ↵Raymond Hettinger2008-06-201-0/+3
| | | | subclasses can override or so that other classes can support.
* This reverts r63675 based on the discussion in this thread:Gregory P. Smith2008-06-091-2/+2
| | | | | | | 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.
* Remove locking part of new buffer protocol.Travis E. Oliphant2008-06-061-11/+0
|
* #2989: add PyType_Modified().Georg Brandl2008-05-281-0/+1
|
* Renamed PyString to PyBytesChristian Heimes2008-05-261-2/+2
|
* Remove Py_Refcnt, Py_Type, Py_Size, as they were added onlyMartin v. Löwis2008-04-241-5/+0
| | | | for backwards compatibility, yet 2.5 did not have them at all.
* NIL => NULLBenjamin Peterson2008-03-281-1/+1
|
* Add necessary headers to back-port new buffer protocol to Python 2.6Travis E. Oliphant2008-03-171-0/+68
|
* Move abc._Abstract into object by adding a new flag Py_TPFLAGS_IS_ABSTRACT,Jeffrey Yasskin2008-02-281-0/+3
| | | | | | | | 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.
* Added clear cache methods to clear the internal type lookup cache for ref ↵Christian Heimes2008-01-271-0/+1
| | | | leak test runs.
* Re-apply patch #1700288 (first applied in r59931, rolled back in r59940)Amaury Forgeot d'Arc2008-01-141-0/+8
| | | | | | now that ctypes uses a more supported method to create types: Method cache optimization, by Armin Rigo, ported to 2.6 by Kevin Jacobs.
* Back out r59931 - test_ctypes fails with it.Georg Brandl2008-01-131-8/+0
|
* Patch #1700288: Method cache optimization, by Armin Rigo, ported toGeorg Brandl2008-01-121-0/+8
| | | | 2.6 by Kevin Jacobs.
* #1629: Renamed Py_Size, Py_Type and Py_Refcnt to Py_SIZE, Py_TYPE and ↵Christian Heimes2007-12-191-12/+17
| | | | Py_REFCNT. Macros for b/w compatibility are available.
* PEP 3123: Provide forward compatibility with Python 3.0, while keepingMartin v. Löwis2007-07-211-12/+18
| | | | | backwards compatibility. Add Py_Refcnt, Py_Type, Py_Size, and PyVarObject_HEAD_INIT.
* Variation of patch # 1624059 to speed up checking if an object is a subclassNeal Norwitz2007-02-251-1/+14
| | | | | | | | | | | | | | | | | | 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.
* Patch #1538606, Patch to fix __index__() clipping.Neal Norwitz2006-08-121-1/+1
| | | | | | | 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.
* Remove types from type_list if they have no objectsMartin v. Löwis2006-04-181-1/+3
| | | | | and unlist_types_without_objects is set. Give dump_counts a FILE* argument.
* There were no comments explaining what Py_CLEAR() did orTim Peters2006-04-151-0/+34
| | | | | | | why it's important. Now there are ;-) If someone else hasn't already, I'll add a Py_CLEAR cleanup task to the TODO Wiki next.
* Ignore the references to the dummy objects used as deleted keysArmin Rigo2006-04-121-0/+3
| | | | in dicts and sets when computing the total number of references.
* Checking in the code for PEP 357.Guido van Rossum2006-03-071-1/+8
| | | | | | 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).
* Use Py_ssize_t for _Py_RefTotal.Neal Norwitz2006-03-041-1/+1
| | | | I tried to handle Win64 properly, but please review.
* Make ob_refcnt and tp_maxalloc (and friends) Py_ssize_t.Martin v. Löwis2006-03-011-4/+4
|
* Revert backwards-incompatible const changes.Martin v. Löwis2006-02-271-4/+4
|
* Bug #1086854: Rename PyHeapType members adding ht_ prefix.Georg Brandl2006-02-201-3/+3
|
* Use Py_ssize_t for field sizes and offsets.Martin v. Löwis2006-02-161-3/+3
|
* Merge ssize_t branch.Martin v. Löwis2006-02-151-17/+31
|
* Add const to several API functions that take char *.Jeremy Hylton2005-12-101-7/+7
| | | | | | | | | | | | | | | | | | | 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 *.
* Change the %s format specifier for str objects so that it returns aNeil Schemenauer2005-08-121-0/+1
| | | | | unicode instance if the argument is not an instance of basestring and calling __str__ on the argument returns a unicode instance.
* A static swapped_op[] array was defined in 3 different C files, & I thinkTim Peters2004-09-231-0/+5
| | | | | I need to define it again. Bite the bullet and define it once as an extern, _Py_SwappedOp[].
* SF patch #1020188: Use Py_CLEAR where necessary to avoid crashesRaymond Hettinger2004-09-011-1/+1
| | | | (Contributed by Dima Dorfman)
* SF bug 994255: Py_RETURN_NONE causes too much warningsTim Peters2004-07-221-1/+1
| | | | | | | | | | Rewrote Py_RETURN_{NONE, TRUE, FALSE} to expand to comma expressions rather than "do {} while(0)" thingies. The OP complained because he likes using MS /W4 sometimes, and then all his uses of these things generate nuisance warnings about testing a constant expression (in the "while(0)" part). Comma expressions don't have this problem (although it's a lucky accident that comma expressions suffice for these macros!).
* Implemented a new Py_CLEAR macro. This macro should be used whenJim Fulton2004-07-141-0/+9
| | | | | decrementing the refcount of variables that might be accessed as a result of calling Python
* Two new public API functions, Py_IncRef and Py_DecRef. Useful forThomas Heller2004-04-221-0/+7
| | | | dynamic embedders of Python.
* fixed buggy comment as per SF bug #827856Alex Martelli2003-11-091-7/+7
| | | | (same as commit of Sun Nov 2 to the release23-maint branch)
* Modify the Py_RETURN_* macros to be of the form ``do {...} while (0)`` in orderBrett Cannon2003-10-191-1/+1
| | | | to handle situations like ``if (foo) Py_RETURN_NONE else ...``.