This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author diana
Recipients diana, docs@python
Date 2014-08-08.20:48:59
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1407530939.59.0.62498014602.issue22174@psf.upfronthosting.co.za>
In-reply-to
Content
The property docs are a bit funky.

    https://docs.python.org/3/library/functions.html#property

1) docstrings have zero to do with making a read-only property. It currently says:

"If given, doc will be the docstring of the property attribute. Otherwise, the property will copy fget‘s docstring (if it exists). This makes it possible to create read-only properties easily using property() as a decorator:"

2) The 'then' in this sentence is awkward (and incorrect English).

"If then c is an instance of C, c.x will invoke the getter, c.x = value will invoke the setter and del c.x the deleter."

3) This sentence is missing a beginning.

"turns the voltage() method into a “getter” for a read-only attribute with the same name."

4) This sentence has an extra comma (after del'ing):

"fget is a function for getting an attribute value, likewise fset is a function for setting, and fdel a function for del’ing, an attribute."

Attached is a patch with minimal changes to the property docs, addressing the above four issues. Okay, that's not entirely true -- I did add an example usage because the current docs don't actually show using a property attribute.

>>> p = Parrot()
>>> p.voltage
100000

I've also attached an "after" screenshot of the docs in case it helps with review.

Cheers,

--diana
History
Date User Action Args
2014-08-08 20:48:59dianasetrecipients: + diana, docs@python
2014-08-08 20:48:59dianasetmessageid: <1407530939.59.0.62498014602.issue22174@psf.upfronthosting.co.za>
2014-08-08 20:48:59dianalinkissue22174 messages
2014-08-08 20:48:59dianacreate