This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author serhiy.storchaka
Recipients rhettinger, serhiy.storchaka
Date 2012-12-12.17:31:32
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1355333495.19.0.152758378027.issue16669@psf.upfronthosting.co.za>
In-reply-to
Content
Here are two patches which implementation two different interface for same feature.

In first patch you can use *doc* and *field_docs* arguments to specify namedtuple class docstring and field docstrings. For example:

    Point = namedtuple('Point', 'x y',
                       doc='Point: 2-dimensional coordinate',
                       field_docs=['abscissa', 'ordinate'])

In second patch you can use *doc* argument to specify namedtuple class docstring and *field_names* argument can be a sequence of pairs: field name and field docstring. For example:

    Point = namedtuple('Point', [('x', 'absciss'), ('y', 'ordinate')],
                       doc='Point: 2-dimensional coordinate')

What approach is better?

Feel free to correct a documentation. I know that it need a correction.
History
Date User Action Args
2012-12-12 17:31:35serhiy.storchakasetrecipients: + serhiy.storchaka, rhettinger
2012-12-12 17:31:35serhiy.storchakasetmessageid: <1355333495.19.0.152758378027.issue16669@psf.upfronthosting.co.za>
2012-12-12 17:31:34serhiy.storchakalinkissue16669 messages
2012-12-12 17:31:34serhiy.storchakacreate