Issue 1005461: property to get the docstring from fget (original) (raw)

Issue1005461

Created on 2004-08-08 11:08 by ddorfman, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
propdoc2.diff ddorfman,2004-08-09 02:06 Correcter change; doc and test the same
Messages (3)
msg46578 - (view) Author: Dima Dorfman (ddorfman) Date: 2004-08-08 11:08
Allow property objects to use the fget function's docstring if a property docstring wasn't specified. This was suggested by someone on python-dev or c.l.py, but I don't remember who it was (sorry). Function docstrings are easier to write (read: prettier) than explicit doc= arguments, so this should make more properties have docstrings, sometimes automagically (I know it will for my code, anyway). It gets even better with syntatic sugar for decorators; read-only properties can now be defined, including docstring, with just one function: @property def golden(self): """The Golden Ratio. (Don't ask why this is a property.)""" return (1 + math.sqrt(5)) / 2 The doc part of the patch also improves some markup in the vicinity.
msg46579 - (view) Author: Dima Dorfman (ddorfman) Date: 2004-08-09 02:06
Logged In: YES user_id=908995 Oops, now that I'm sufficiently awake, it's pretty obvious that the patch is broken--it leaks a reference every time the new code runs. Mea culpa! Corrected patch attached.
msg46580 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2006-05-22 10:16
Logged In: YES user_id=849994 This was addressed by patch 1434038.
History
Date User Action Args
2022-04-11 14:56:06 admin set github: 40714
2004-08-08 11:08:17 ddorfman create