Re: [Python-Dev] [Python-checkins] cpython: Issue #24064: Property() docstrings are now writeable.
On 5/13/2015 4:10 AM, raymond.hettinger wrote:
https://hg.python.org/cpython/rev/1e8a768fa0a5 changeset: 96010:1e8a768fa0a5 user: Raymond Hettinger <python@rcn.com> date: Wed May 13 01:09:59 2015 -0700 summary: Issue #24064: Property() docstrings are now writeable. (Patch by Berker Peksag.)
diff --git a/Doc/library/collections.rst b/Doc/library/collections.rst --- a/Doc/library/collections.rst +++ b/Doc/library/collections.rst @@ -924,6 +924,15 @@
>>> Point3D = namedtuple('Point3D', Point._fields + ('z',))
+Docstrings can be customized by making direct assignments to the ``__doc__`` +fields: + + >>> Book = namedtuple('Book', ['id', 'title', 'authors']) + >>> Book.__doc__ = 'Hardcover book in active collection' + >>> Book.id = '13-digit ISBN' + >>> Book.title = 'Title of first printing' + >>> Book.author = 'List of authors sorted by last name'
Should these be: Book.id.__doc__ = ... etc.?
+ Point = namedtuple('Point', ['x', 'y']) + Point.__doc__ = 'ordered pair' + Point.x.__doc__ = 'abscissa' + Point.y.__doc__ = 'ordinate'
These lines from /Doc/whatsnew/3.5.rst would make me think so. Eric.
On Wed, May 13, 2015 at 11:56 AM, Eric V. Smith <eric@trueblade.com> wrote:
On 5/13/2015 4:10 AM, raymond.hettinger wrote:
https://hg.python.org/cpython/rev/1e8a768fa0a5 changeset: 96010:1e8a768fa0a5 user: Raymond Hettinger <python@rcn.com> date: Wed May 13 01:09:59 2015 -0700 summary: Issue #24064: Property() docstrings are now writeable. (Patch by Berker Peksag.)
diff --git a/Doc/library/collections.rst b/Doc/library/collections.rst --- a/Doc/library/collections.rst +++ b/Doc/library/collections.rst @@ -924,6 +924,15 @@
>>> Point3D = namedtuple('Point3D', Point._fields + ('z',))
+Docstrings can be customized by making direct assignments to the ``__doc__`` +fields: + + >>> Book = namedtuple('Book', ['id', 'title', 'authors']) + >>> Book.__doc__ = 'Hardcover book in active collection' + >>> Book.id = '13-digit ISBN' + >>> Book.title = 'Title of first printing' + >>> Book.author = 'List of authors sorted by last name'
Should these be: Book.id.__doc__ = ... etc.?
Hi Eric, Good catch. Fixed in https://hg.python.org/cpython/rev/bde652ae05fd Thanks! --Berker
+ Point = namedtuple('Point', ['x', 'y']) + Point.__doc__ = 'ordered pair' + Point.x.__doc__ = 'abscissa' + Point.y.__doc__ = 'ordinate'
These lines from /Doc/whatsnew/3.5.rst would make me think so.
Eric.
_______________________________________________ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/berker.peksag%40gmail.com
participants (2)
-
Berker Peksağ
-
Eric V. Smith