[issue16669] Docstrings for namedtuple

Raymond Hettinger report at bugs.python.org
Mon Apr 27 16:56:38 CEST 2015


Raymond Hettinger added the comment:

Sorry Peter, I don't like that variant and want to stick with a separate customization step that uses **kwds so we can use normal syntax for the name value pairs and to allow that possibility of someone passing in an existing dict using NT.set_docstrings(**d).

Also FWIW, the addition can be simplified a bit when Issue 24064 is added:

        for fieldname, docstring in docstrings.items():
            getattr(cls, fieldname).__doc__ = docstring

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue16669>
_______________________________________


More information about the Python-bugs-list mailing list