[Python-checkins] cpython (3.4): Issue #20786: Fix signatures for dict.__delitem__ and property.__delete__

larry.hastings python-checkins at python.org
Mon Mar 17 07:33:11 CET 2014


http://hg.python.org/cpython/rev/7ad0e19cc682
changeset: 89779:7ad0e19cc682
branch: 3.4
user: Yury Selivanov <yselivanov at sprymix.com>
date: Sun Mar 02 12:25:27 2014 -0500
summary:
 Issue #20786: Fix signatures for dict.__delitem__ and property.__delete__
files:
 Lib/test/test_inspect.py | 5 +++++
 Misc/NEWS | 7 ++++++-
 Objects/typeobject.c | 4 ++--
 3 files changed, 13 insertions(+), 3 deletions(-)
diff --git a/Lib/test/test_inspect.py b/Lib/test/test_inspect.py
--- a/Lib/test/test_inspect.py
+++ b/Lib/test/test_inspect.py
@@ -1764,6 +1764,11 @@
 __call__ = type
 test_callable(ThisWorksNow())
 
+ # Regression test for issue #20786
+ test_unbound_method(dict.__delitem__)
+ test_unbound_method(property.__delete__)
+
+
 @cpython_only
 @unittest.skipIf(MISSING_C_DOCSTRINGS,
 "Signature information for builtins requires docstrings")
diff --git a/Misc/NEWS b/Misc/NEWS
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -4,9 +4,14 @@
 
 What's New in Python 3.4.0 release candidate 3?
 ===============================================
-
 Release date: 2014年03月09日
 
+Core and Builtins
+-----------------
+
+- Issue #20786: Fix signatures for dict.__delitem__ and
+ property.__delete__ builtins.
+
 Build
 -----
 
diff --git a/Objects/typeobject.c b/Objects/typeobject.c
--- a/Objects/typeobject.c
+++ b/Objects/typeobject.c
@@ -6189,7 +6189,7 @@
 "__set__($self, instance, value, /)\n--\n\nSet an attribute of instance to value."),
 TPSLOT("__delete__", tp_descr_set, slot_tp_descr_set,
 wrap_descr_delete,
- "__delete__(instance, /)\n--\n\nDelete an attribute of instance."),
+ "__delete__($self, instance, /)\n--\n\nDelete an attribute of instance."),
 FLSLOT("__init__", tp_init, slot_tp_init, (wrapperfunc)wrap_init,
 "__init__($self, /, *args, **kwargs)\n--\n\n"
 "Initialize self. See help(type(self)) for accurate signature.",
@@ -6286,7 +6286,7 @@
 "__setitem__($self, key, value, /)\n--\n\nSet self[key] to value."),
 MPSLOT("__delitem__", mp_ass_subscript, slot_mp_ass_subscript,
 wrap_delitem,
- "__delitem__(key)\n--\n\nDelete self[key]."),
+ "__delitem__($self, key, /)\n--\n\nDelete self[key]."),
 
 SQSLOT("__len__", sq_length, slot_sq_length, wrap_lenfunc,
 "__len__($self, /)\n--\n\nReturn len(self)."),
-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /