[Python-ideas] Docstrings for namedtuple

M.-A. Lemburg mal at egenix.com
Wed Dec 12 20:56:40 CET 2012


On 12.12.2012 18:40, Serhiy Storchaka wrote:
> What interface is better for specifying namedtuple field docstrings?
> 
>     Point = namedtuple('Point', 'x y',
>                        doc='Point: 2-dimensional coordinate',
>                        field_docs=['abscissa', 'ordinate'])
> 
> or
> 
>     Point = namedtuple('Point', [('x', 'absciss'), ('y', 'ordinate')],
>                        doc='Point: 2-dimensional coordinate')
> 
> ?
>
> http://bugs.python.org/issue16669

IMO, attributes should be documented in the existing doc parameter,
not separately. This makes the intention clear and the code overall
more readable.

-- 
Marc-Andre Lemburg
eGenix.com

Professional Python Services directly from the Source  (#1, Dec 12 2012)
>>> Python Projects, Consulting and Support ...   http://www.egenix.com/
>>> mxODBC.Zope/Plone.Database.Adapter ...       http://zope.egenix.com/
>>> mxODBC, mxDateTime, mxTextTools ...        http://python.egenix.com/
________________________________________________________________________
2012-12-05: Released eGenix pyOpenSSL 0.13 ...    http://egenix.com/go37
2012-11-28: Released eGenix mx Base 3.2.5 ...     http://egenix.com/go36
2013-01-22: Python Meeting Duesseldorf ...                 41 days to go

::::: Try our mxODBC.Connect Python Database Interface for free ! ::::::

   eGenix.com Software, Skills and Services GmbH  Pastor-Loeh-Str.48
    D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg
           Registered at Amtsgericht Duesseldorf: HRB 46611
               http://www.egenix.com/company/contact/



More information about the Python-ideas mailing list