]> granicus.if.org Git - python/commitdiff
Merged revisions 68568,68665 via svnmerge from
authorBenjamin Peterson <benjamin@python.org>
Sun, 18 Jan 2009 22:10:38 +0000 (22:10 +0000)
committerBenjamin Peterson <benjamin@python.org>
Sun, 18 Jan 2009 22:10:38 +0000 (22:10 +0000)
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r68568 | georg.brandl | 2009-01-13 02:11:07 -0600 (Tue, 13 Jan 2009) | 2 lines

  Fix call signature and markup.
........
  r68665 | amaury.forgeotdarc | 2009-01-17 11:11:50 -0600 (Sat, 17 Jan 2009) | 3 lines

  #4930: Slightly cleaner (and faster) code in type creation:
  compare slots by address, not by name.
........

Doc/c-api/init.rst
Objects/typeobject.c

index 95466cf32151c380e6c76b9b4781b6447489e6f6..e2b2267a11a06d27e56e807f1d03814a8fa58272 100644 (file)
@@ -782,13 +782,13 @@ from a worker thread and the actual call than made at the earliest
 convenience by the main thread where it has possession of the global
 interpreter lock and can perform any Python API calls.
 
-.. cfunction:: void Py_AddPendingCall( int (*func)(void *), void *arg) )
+.. cfunction:: void Py_AddPendingCall( int (*func)(void *, void *arg) )
 
    .. index:: single: Py_AddPendingCall()
 
    Post a notification to the Python main thread.  If successful,
-   \*:attr`func` will be called with the argument :attr:`arg` at the earliest
-   convenience.  \*:attr:`func` will be called having the global interpreter
+   *func* will be called with the argument *arg* at the earliest
+   convenience.  *func* will be called having the global interpreter
    lock held and can thus use the full Python API and can take any
    action such as setting object attributes to signal IO completion.
    It must return 0 on success, or -1 signalling an exception.
index b02f108e198c88b717b70c8698a50a138b658d93..b2ad89f4527176654565eac3fbde1179c9e3d9a7 100644 (file)
@@ -5650,7 +5650,7 @@ update_one_slot(PyTypeObject *type, slotdef *p)
                else if (Py_TYPE(descr) == &PyCFunction_Type &&
                         PyCFunction_GET_FUNCTION(descr) ==
                         (PyCFunction)tp_new_wrapper &&
-                        strcmp(p->name, "__new__") == 0)
+                        ptr == (void**)&type->tp_new)
                {
                        /* The __new__ wrapper is not a wrapper descriptor,
                           so must be special-cased differently.
@@ -5670,7 +5670,7 @@ update_one_slot(PyTypeObject *type, slotdef *p)
                           point out a bug in this reasoning a beer. */
                }
                else if (descr == Py_None &&
-                        strcmp(p->name, "__hash__") == 0) {
+                        ptr == (void**)&type->tp_hash) {
                        /* We specifically allow __hash__ to be set to None
                           to prevent inheritance of the default
                           implementation from object.__hash__ */