summaryrefslogtreecommitdiffstats
path: root/Include/descrobject.h
Commit message (Collapse)AuthorAgeFilesLines
* Patch #536908: Add missing #include guards/extern "C".Martin v. Löwis2002-03-301-0/+10
|
* Methods of built-in types now properly check for keyword argumentsGuido van Rossum2001-10-221-0/+7
| | | | | (formerly these were silently ignored). The only built-in methods that take keyword arguments are __call__, __init__ and __new__.
* Big internal change that should have no external effects: unify theGuido van Rossum2001-10-211-0/+3
| | | | | | | | | '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.
* *EXPERIMENTAL* speedup of slot_sq_item. This sped up the followingGuido van Rossum2001-10-031-0/+34
| | | | | | | | | | | | | | | | | | | | | | | 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.
* Add optional docstrings to getset descriptors. Fortunately, there'sGuido van Rossum2001-09-201-4/+5
| | | | | | | | | | 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.
* Add optional docstrings to member descriptors. For backwardsGuido van Rossum2001-09-201-1/+1
| | | | | | | | | | | | | | | 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.
* Rename 'getset' to 'property'.Guido van Rossum2001-09-061-1/+1
|
* Add new built-in type 'getset' (PyGetSet_Type).Guido van Rossum2001-08-231-0/+3
| | | | This implements the 'getset' class from test_binop.py.
* Merge of descr-branch back into trunk.Tim Peters2001-08-021-0/+32