summaryrefslogtreecommitdiffstats
path: root/Include/object.h
Commit message (Collapse)AuthorAgeFilesLines
* Introduction to rich comparisons:Guido van Rossum2001-01-171-12/+22
| | | | | | | | | | | | | | - Removed the nb_add slot from the PyNumberMethods struct. - Renamed Py_TPFLAGS_NEWSTYLENUMBER to Py_TPFLAGS_CHECKTYPES. - Added typedef richcmpfunc. - Added tp_richcompare slot to PyTypeObject (replacing spare tp_xxx7). - Added APIs PyObject_RichCompare() and PyObject_RichCompareBool(). - Added rich comparison operators Py_LT through Py_GE.
* - Add nb_cmp slot for new style nubmers.Neil Schemenauer2001-01-041-0/+22
| | | | | - Define type flag for new style numbers. - Add Py_NotImplemented.
* Close SF bug 110826: a complaint about the way Python #define'd NULL.Tim Peters2000-09-101-7/+0
| | | | | | | | | | | | | | | It's hard to sort out what the bug was, exactly. So, Big Hammer: 1. Python shouldn't be in the business of #define'ing NULL, period. 2. Users of the Python C API shouldn't be in the business of not including Python.h, period. Hence: 1. Removed all #define's of NULL in Python source code (pyport.h and object.h). 2. Since we're *relying* on stdio.h defining NULL, put an #error in Python.h after its #include of stdio.h if NULL isn't defined then.
* REMOVED all CWI, CNRI and BeOpen copyright markings.Guido van Rossum2000-09-011-9/+0
| | | | This should match the situation in the 1.6b1 tree.
* The real suport for augmented assignment: new opcodes, new PyNumber andThomas Wouters2000-08-241-1/+18
| | | | PySequence methods and functions, new tokens.
* Spelling fixes supplied by Rob W. W. Hooft. All these are fixes in eitherThomas Wouters2000-07-161-3/+3
| | | | | | | | | | comments, docstrings or error messages. I fixed two minor things in test_winreg.py ("didn't" -> "Didn't" and "Didnt" -> "Didn't"). There is a minor style issue involved: Guido seems to have preferred English grammar (behaviour, honour) in a couple places. This patch changes that to American, which is the more prominent style in the source. I prefer English myself, so if English is preferred, I'd be happy to supply a patch myself ;)
* Remove legacy use of __SC__; no longer needed now that ANSI source isFred Drake2000-07-091-4/+0
| | | | the standard for Python implementation.
* One of the new prototypes was missing the "void" args.Greg Stein2000-07-081-1/+1
|
* Got RID of redundant coercions in longobject.c (as spotted by GregTim Peters2000-07-081-54/+54
| | | | | | | Stein -- thanks!). Incidentally removed all the Py_PROTO macros from object.h, as they prevented my editor from magically finding the definitions of the "coercion", "cmpfunc" and "reprfunc" typedefs that were being redundantly applied in longobject.c.
* Change copyright notice - 2nd try.Guido van Rossum2000-06-301-6/+0
|
* Change copyright notice.Guido van Rossum2000-06-301-22/+7
|
* This patch addresses two main issues: (1) There exist some non-fatalFred Drake2000-06-291-0/+4
| | | | | | | | | | | | | | | | | | | | errors in some of the hash algorithms. For exmaple, in float_hash and complex_hash a certain part of the value is not included in the hash calculation. See Tim's, Guido's, and my discussion of this on python-dev in May under the title "fix float_hash and complex_hash for 64-bit *nix" (2) The hash algorithms that use pointers (e.g. func_hash, code_hash) are universally not correct on Win64 (they assume that sizeof(long) == sizeof(void*)) As well, this patch significantly cleans up the hash code. It adds the two function _Py_HashDouble and _PyHash_VoidPtr that the various hashing routine are changed to use. These help maintain the hash function invariant: (a==b) => (hash(a)==hash(b))) I have added Lib/test/test_hash.py and Lib/test/output/test_hash to test this for some cases.
* part 2 of Neil Schemenauer's GC patches:Jeremy Hylton2000-06-231-0/+7
| | | | | | | | This patch modifies the type structures of objects that participate in GC. The object's tp_basicsize is increased when GC is enabled. GC information is prefixed to the object to maintain binary compatibility. GC objects also define the tp_flag Py_TPFLAGS_GC.
* Round 1 of Neil Schemenauer's GC patches:Jeremy Hylton2000-06-231-2/+8
| | | | | This patch adds the type methods traverse and clear necessary for GC implementation.
* Christian Tismer -- total rewrite on trashcan code.Guido van Rossum2000-04-241-2/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Improvements: - does no longer need any extra memory - has no relationship to tstate - works in debug mode - can easily be modified for free threading (hi Greg:) Side effects: Trashcan does change the order of object destruction. Prevending that would be quite an immense effort, as my attempts have shown. This version works always the same, with debug mode or not. The slightly changed destruction order should therefore be no problem. Algorithm: While the old idea of delaying the destruction of some obejcts at a certain recursion level was kept, we now no longer aloocate an object to hold these objects. The delayed objects are instead chained together via their ob_type field. The type is encoded via ob_refcnt. When it comes to the destruction of the chain of waiting objects, the topmost object is popped off the chain and revived with type and refcount 1, then it gets a normal Py_DECREF. I am confident that this solution is near optimum for minimizing side effects and code bloat.
* Fix PR#7 comparisons of recursive objectsJeremy Hylton2000-04-141-0/+3
| | | | | Note that comparisons of deeply nested objects can still dump core in extreme cases.
* Updated comment: in PyTypeObject:Fred Drake2000-03-211-1/+1
| | | | | | | | | | /* More standard operations (at end for binary compatibility) */ should now be: /* More standard operations (here for binary compatibility) */ since they're no longer at the end!
* Christian Tismer's "trashcan" patch:Guido van Rossum2000-03-131-0/+47
| | | | | | | | Added wrapping macros to dictobject.c, listobject.c, tupleobject.c, frameobject.c, traceback.c that safely prevends core dumps on stack overflow. Macros and functions in object.c, object.h. The method is an "elevator destructor" that turns cascading deletes into tail recursive behavior when some limit is hit.
* Got rid of silly "123456789-..." lines in comments.Guido van Rossum2000-03-011-12/+0
|
* Patch by Mozhe Zadka, for __contains__ (overloading 'in'). This addsGuido van Rossum2000-02-281-1/+7
| | | | | | a new proc type (objobjproc), a new slot sq_contains to PySequenceMethods, and a new flag Py_TPFLAGS_HAVE_SEQUENCE_IN to Py_TPFLAGS_DEFAULT. More to follow.
* The rest of the changes by Trent Mick and Dale Nagata for warning-freeGuido van Rossum2000-01-201-0/+1
| | | | compilation on NT Alpha. Mostly added casts etc.
* Add DL_IMPORT(returntype) for all officially exported functions.Guido van Rossum1998-12-041-24/+24
|
* Changes by Greg Stein (code) and GvR (design).Guido van Rossum1998-10-081-2/+35
| | | | | | | | | | | | | | | | | | | | | | | | Add a new member to the PyBufferProcs struct, bf_getcharbuffer. For backward compatibility, this member should only be used (this includes testing for NULL!) when the flag Py_TPFLAGS_HAVE_GETCHARBUFFER is set in the type structure, below. Note that if its flag is not set, we may be looking at an extension module compiled for 1.5.1, which will have garbage at the bf_getcharbuffer member (because the struct wasn't as long then). If the flag is one, the pointer may still be NULL. The function found at this member is used in a similar manner as bf_getreadbuffer, but it is known to point to 8-bit character data. (See discussion in getargs.c checked in later.) As a general feature for extending the type structure and the various structures that (may) hang off it in a backwards compatible way, we rename the tp_xxx4 "spare" slot to tp_flags. In 1.5.1 and before, this slot was always zero. In 1.5.1, it may contain various flags indicating extra fields that weren't present in 1.5.1. The only flag defined so far is for the bf_getcharbuffer member of the PyBufferProcs struct. Note that the new spares (tp_xxx5 - tp_xxx8), once they become used, should also be protected by a flag (or flags) in tp_flags.
* Add new spares to the end of the type object struct.Guido van Rossum1998-04-231-0/+6
|
* Add prototypes for Py_Repr{Enter,Leave}.Guido van Rossum1998-04-101-0/+4
| | | | (Jeremy will hardly recognize his patch :-)
* Add PyObject_Not().Guido van Rossum1998-04-091-0/+1
|
* Add declaration for PyNumber_CoerceEx().Guido van Rossum1997-11-191-0/+1
|
* #Added prototype for PyObject_HasAttr() -- must've been an oversight.Guido van Rossum1997-09-061-0/+1
|
* Fix in trailing comment: PyDict_SetItemString() does *not* consume a referenceFred Drake1997-09-051-3/+2
| | | | count, PyList_SetItem() does. Very confusing!
* Add a cast to the call to _Py_Dealloc in the expanded version ofGuido van Rossum1997-08-051-2/+2
| | | | | | Py_DECREF, to reduce the warnings when compiling with reference count debugging on. (There are still warnings for each call to _Py_NewReference -- too bad.)
* Oops, another forgotten renaming: varobject -> PyVarObject.Guido van Rossum1997-05-151-1/+1
|
* Checkin of Jack's buffer mods.Guido van Rossum1997-05-051-1/+13
| | | | Not really checked, but didn't fail any tests either...
* Rename DEBUG macro to Py_DEBUGGuido van Rossum1996-12-301-2/+2
|
* New permission notice, includes CNRI.Guido van Rossum1996-10-251-13/+20
|
* Added extern declarations for reference count admin debug functions.Guido van Rossum1996-08-121-3/+10
|
* Added tp_getattro, tp_setattro (Sjoerd)Guido van Rossum1996-08-091-2/+4
|
* don't use NDEBUGGuido van Rossum1996-05-241-6/+2
|
* Added some visual enhancements of debugging ifdefs.Guido van Rossum1996-05-221-5/+11
| | | | Added PyNumber_Coerce decl.
* add forgotten PyObject_SetAttrStringGuido van Rossum1995-07-261-0/+1
|
* keyword arguments and faster function callsGuido van Rossum1995-07-181-1/+1
|
* DL_IMPORT needs an argument.Sjoerd Mullender1995-04-251-2/+2
|
* DL_IMPORT macro was called in a funny way (and MW barfed on it)Jack Jansen1995-04-231-2/+2
|
* Also count UNREF's as freeing an object (only relevant whenSjoerd Mullender1995-04-061-1/+2
| | | | COUNT_ALLOCS is defined).
* fix dusty debugging macrosGuido van Rossum1995-03-291-5/+5
|
* make the type a parameter of the DL_IMPORT macro, for Borland CGuido van Rossum1995-02-271-2/+2
|
* change in staticforward -- added statichereGuido van Rossum1995-02-211-1/+7
|
* added PyObject_IsTrue & PyCallable_Check to object interfaceGuido van Rossum1995-02-171-0/+2
|
* new names for lots of new functionsGuido van Rossum1995-01-171-2/+2
|
* The great renaming, phase two: all header files have been updated toGuido van Rossum1995-01-121-91/+94
| | | | | | | use the new names exclusively, and the linker will see the new names. Files that import "Python.h" also only see the new names. Files that import "allobjects.h" will continue to be able to use the old names, due to the inclusion (in allobjects.h) of "rename2.h".
* new tp_str and tp_doc members in type objectGuido van Rossum1995-01-071-0/+10
|