summaryrefslogtreecommitdiff
path: root/Objects/descrobject.c
Commit message (Collapse)AuthorAgeFilesLines
* Add optional docstrings to getset descriptors. Fortunately, there'sGuido van Rossum2001-09-201-7/+22
| | | | | | | | | | 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-10/+23
| | | | | | | | | | | | | | | 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-23/+23
|
* Make getset subclassable.Guido van Rossum2001-08-301-1/+1
|
* getset_init(): the function name in the PyArg_ParseTuple() formatGuido van Rossum2001-08-241-1/+1
| | | | should just be "getset", not "getset.__init__".
* repr's converted to using PyString_FromFormat() instead of sprintf'ingBarry Warsaw2001-08-241-10/+8
| | | | | | into a hardcoded char* buffer. Closes patch #454743.
* Change the getset type to take an optional third function argument:Guido van Rossum2001-08-241-9/+21
| | | | | | the delete function. (Question: should the attribute name also be recorded in the getset object? That makes the protocol more work, but may give us better error messages.)
* getset_descr_set(): guard against deletion (indicated by a set callGuido van Rossum2001-08-241-1/+4
| | | | | with a NULL value), in a somewhat lame way: call the set() function with one argument. Should I add a 3rd function, 'del', instead?
* getset_init(): make the arguments optional.Guido van Rossum2001-08-241-3/+11
| | | | getset_doc: add docstring.
* Add new built-in type 'getset' (PyGetSet_Type).Guido van Rossum2001-08-231-0/+135
| | | | This implements the 'getset' class from test_binop.py.
* Patch #427190: Implement and use METH_NOARGS and METH_O.Martin v. Löwis2001-08-161-22/+10
|
* Subtle change to make None.__class__ work:Guido van Rossum2001-08-161-2/+2
| | | | | | | | | - 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.
* Merge of descr-branch back into trunk.Tim Peters2001-08-021-0/+854