Message225090
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." |
|
Date |
User |
Action |
Args |
2014-08-08 22:05:53 | r.david.murray | set | recipients:
+ r.david.murray, docs@python, diana |
2014-08-08 22:05:53 | r.david.murray | set | messageid: <1407535553.01.0.463770345104.issue22174@psf.upfronthosting.co.za> |
2014-08-08 22:05:53 | r.david.murray | link | issue22174 messages |
2014-08-08 22:05:52 | r.david.murray | create | |
|