diff options
author | Benjamin Peterson <benjamin@python.org> | 2009-01-18 22:10:38 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2009-01-18 22:10:38 (GMT) |
commit | b54797951595f69c38aebbf739e22e540e40f311 (patch) | |
tree | 1c65c7193d8a6ae05068f92bf2d85248ada981e3 /Objects | |
parent | 9a0fc97bf4a336d81160b19a52ab4f5d2e2317e0 (diff) | |
download | cpython-b54797951595f69c38aebbf739e22e540e40f311.zip cpython-b54797951595f69c38aebbf739e22e540e40f311.tar.gz cpython-b54797951595f69c38aebbf739e22e540e40f311.tar.bz2 |
Merged revisions 68568,68665 via svnmerge from
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.
........
Diffstat (limited to 'Objects')
-rw-r--r-- | Objects/typeobject.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Objects/typeobject.c b/Objects/typeobject.c index b02f108..b2ad89f 100644 --- a/Objects/typeobject.c +++ b/Objects/typeobject.c @@ -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__ */ |