[docs] [issue22174] property doc fixes
R. David Murray
report at bugs.python.org
Sat Aug 9 00:05:53 CEST 2014
R. David Murray added the comment:
The docstring discussion is correct in the context. property can easily be used to create a read only property because when used as a decorator the function that follows the decorator call is passed to it as fget, *and it copies the docstring from the function into the created property*.
The 'then' is indeed redundant (if kept should properly be set of by commas, but there is no reason to keep it).
'turns the voltage' is still part of the previous sentence. Read it as "create read-only properties easily using property() as a decorator as follows...[this example] turns the voltage() method into a..." Your reformulation is, however, clearer.
The comma in the 'fget is a function' sentence is in the correct place. "and fdel a function for del'ing" is phrase...I forget the formal name for the type of phrase. It's analogous to the structure of this sentence: "She forgot to bring not only her lunch, but also her wallet, to work". However, the comma after 'value' should technically be a semicolon. Although correct, I think the whole sentence would read better if it instead said "fget is a function for getting an attribute value, fset is a function for setting an attribute value, and fdel is a function for del'ing an attribute."
Python tracker <report at bugs.python.org>
More information about the docs