Commit graph

25 commits

Author SHA1 Message Date
INADA Naoki 5566bbb8d5 Issue #29263: LOAD_METHOD support for C methods
Calling builtin method is at most 10% faster.
2017-02-03 07:43:03 +09:00
Serhiy Storchaka 007d7ff73f Issue #28761: The fields name and doc of structures PyMemberDef, PyGetSetDef,
PyStructSequence_Field, PyStructSequence_Desc, and wrapperbase are now of
type "const char *" rather of "char *".
2016-11-22 07:58:08 +02:00
Serhiy Storchaka 9fab79bcb5 Issue #26900: Excluded underscored names and other private API from limited API. 2016-09-11 11:03:14 +03:00
Antoine Pitrou 9d57481f04 Issue #13577: various kinds of descriptors now have a __qualname__ attribute.
Patch by sbt.
2011-12-12 13:47:25 +01:00
Benjamin Peterson eff61f6927 make sure to initialize the method wrapper type 2011-09-01 16:32:31 -04:00
Martin v. Löwis 4d0d471a80 Merge branches/pep-0384. 2010-12-03 20:14:31 +00:00
Antoine Pitrou f95a1b3c53 Recorded merge of revisions 81029 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r81029 | antoine.pitrou | 2010-05-09 16:46:46 +0200 (dim., 09 mai 2010) | 3 lines

  Untabify C files. Will watch buildbots.
........
2010-05-09 15:52:27 +00:00
Alexandre Vassalotti 2db046dc39 Issue #6151: Make PyDescr_COMMON conform to standard C. 2009-07-22 03:56:36 +00:00
Benjamin Peterson 89b8917022 remove duplicate declartions #6405 2009-07-03 13:30:25 +00:00
Benjamin Peterson fd838e6c84 Merged revisions 71734,71738-71739 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r71734 | benjamin.peterson | 2009-04-18 17:15:26 -0500 (Sat, 18 Apr 2009) | 1 line

  many more types to initialize (I had to expose some of them)
........
  r71738 | benjamin.peterson | 2009-04-18 21:32:42 -0500 (Sat, 18 Apr 2009) | 1 line

  initialize weakref some weakref types
........
  r71739 | benjamin.peterson | 2009-04-18 21:40:43 -0500 (Sat, 18 Apr 2009) | 1 line

  make errors consistent
........
2009-04-20 02:09:13 +00:00
Christian Heimes 90aa7646af #1629: Renamed Py_Size, Py_Type and Py_Refcnt to Py_SIZE, Py_TYPE and Py_REFCNT. 2007-12-19 02:45:37 +00:00
Christian Heimes a22e8bdfd9 Added all PyTypeObjects to the appropriate header files.
Before the patch a lot of internal types weren't available in the header files. The patch exposes the new iterators, views and some other types to all C modules. I've also renamed some of the types and tp_names.
2007-11-29 22:35:39 +00:00
Martin v. Löwis 9f2e346911 Merged revisions 56467-56482 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/p3yk

................
  r56477 | martin.v.loewis | 2007-07-21 09:04:38 +0200 (Sa, 21 Jul 2007) | 11 lines

  Merged revisions 56466-56476 via svnmerge from
  svn+ssh://pythondev@svn.python.org/python/trunk

  ........
    r56476 | martin.v.loewis | 2007-07-21 08:55:02 +0200 (Sa, 21 Jul 2007) | 4 lines

    PEP 3123: Provide forward compatibility with Python 3.0, while keeping
    backwards compatibility. Add Py_Refcnt, Py_Type, Py_Size, and
    PyVarObject_HEAD_INIT.
  ........
................
  r56478 | martin.v.loewis | 2007-07-21 09:47:23 +0200 (Sa, 21 Jul 2007) | 2 lines

  PEP 3123: Use proper C inheritance for PyObject.
................
  r56479 | martin.v.loewis | 2007-07-21 10:06:55 +0200 (Sa, 21 Jul 2007) | 3 lines

  Add longintrepr.h to Python.h, so that the compiler can
  see that PyFalse is really some kind of PyObject*.
................
  r56480 | martin.v.loewis | 2007-07-21 10:47:18 +0200 (Sa, 21 Jul 2007) | 2 lines

  Qualify SHIFT, MASK, BASE.
................
  r56482 | martin.v.loewis | 2007-07-21 19:10:57 +0200 (Sa, 21 Jul 2007) | 2 lines

  Correctly refer to _ob_next.
................
2007-07-21 17:22:18 +00:00
Tim Peters bca1cbc6f8 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.
2002-12-09 22:56:13 +00:00
Guido van Rossum 492b46f29e Make PyDescr_IsData() a macro. It's too simple to be a function.
Should save 4% on slot lookups.
2002-08-19 18:45:37 +00:00
Mark Hammond 91a681debf Excise DL_EXPORT from Include.
Thanks to Skip Montanaro and Kalle Svensson for the patches.
2002-08-12 07:21:58 +00:00
Martin v. Löwis 522cf1f6fb Patch #536908: Add missing #include guards/extern "C". 2002-03-30 08:57:12 +00:00
Guido van Rossum c8e5645f15 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__.
2001-10-22 00:43:43 +00:00
Guido van Rossum 6d204074cb 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.
2001-10-21 00:44:31 +00:00
Guido van Rossum f4593e0b65 *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.
2001-10-03 12:09:30 +00:00
Guido van Rossum 32d34c809f 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.
2001-09-20 21:45:26 +00:00
Guido van Rossum 6f7993765a 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.
2001-09-20 20:46:19 +00:00
Guido van Rossum 8bce4acb17 Rename 'getset' to 'property'. 2001-09-06 21:56:42 +00:00
Guido van Rossum 29a62dd6eb Add new built-in type 'getset' (PyGetSet_Type).
This implements the 'getset' class from test_binop.py.
2001-08-23 21:40:38 +00:00
Tim Peters 6d6c1a35e0 Merge of descr-branch back into trunk. 2001-08-02 04:15:00 +00:00