You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
propdoc2.diff: Correcter change; doc and test the same
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee=Noneclosed_at=<Date2006-05-22.10:16:12.000>created_at=<Date2004-08-08.11:08:17.000>labels= ['extension-modules']
title='property to get the docstring from fget'updated_at=<Date2006-05-22.10:16:12.000>user='https://bugs.python.org/ddorfman'
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:
@propertydefgolden(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.
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.
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: