[Python-checkins] bpo-43721: Fix docstrings for property.getter/setter/deleter (GH-31046)

miss-islington webhook-mailer at python.org
Mon Mar 14 19:55:22 EDT 2022


https://github.com/python/cpython/commit/f1a5e1b89a526da0d66c5b368c924298291abb1a
commit: f1a5e1b89a526da0d66c5b368c924298291abb1a
branch: 3.9
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: miss-islington <31488909+miss-islington at users.noreply.github.com>
date: 2022-03-14T16:55:12-07:00
summary:

bpo-43721: Fix docstrings for property.getter/setter/deleter (GH-31046)

(cherry picked from commit e3d348a5252549708fd19338b675a2c23b60d677)

Co-authored-by: Irit Katriel <1055913+iritkatriel at users.noreply.github.com>

files:
A Misc/NEWS.d/next/Core and Builtins/2022-02-01-10-05-27.bpo-43721.-1XAIo.rst
M Objects/descrobject.c

diff --git a/Misc/NEWS.d/next/Core and Builtins/2022-02-01-10-05-27.bpo-43721.-1XAIo.rst b/Misc/NEWS.d/next/Core and Builtins/2022-02-01-10-05-27.bpo-43721.-1XAIo.rst
new file mode 100644
index 0000000000000..4e3ad02057ada
--- /dev/null
+++ b/Misc/NEWS.d/next/Core and Builtins/2022-02-01-10-05-27.bpo-43721.-1XAIo.rst	
@@ -0,0 +1 @@
+Fix docstrings of :attr:`~property.getter`, :attr:`~property.setter`, and :attr:`~property.deleter` to clarify that they create a new copy of the property.
\ No newline at end of file
diff --git a/Objects/descrobject.c b/Objects/descrobject.c
index ee40645955206..00349ab17912e 100644
--- a/Objects/descrobject.c
+++ b/Objects/descrobject.c
@@ -1508,7 +1508,7 @@ static PyMemberDef property_members[] = {
 
 
 PyDoc_STRVAR(getter_doc,
-             "Descriptor to change the getter on a property.");
+             "Descriptor to obtain a copy of the property with a different getter.");
 
 static PyObject *
 property_getter(PyObject *self, PyObject *getter)
@@ -1518,7 +1518,7 @@ property_getter(PyObject *self, PyObject *getter)
 
 
 PyDoc_STRVAR(setter_doc,
-             "Descriptor to change the setter on a property.");
+             "Descriptor to obtain a copy of the property with a different setter.");
 
 static PyObject *
 property_setter(PyObject *self, PyObject *setter)
@@ -1528,7 +1528,7 @@ property_setter(PyObject *self, PyObject *setter)
 
 
 PyDoc_STRVAR(deleter_doc,
-             "Descriptor to change the deleter on a property.");
+             "Descriptor to obtain a copy of the property with a different deleter.");
 
 static PyObject *
 property_deleter(PyObject *self, PyObject *deleter)



More information about the Python-checkins mailing list