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 Laur Joost
Recipients Laur Joost, docs@python
Date 2015-11-23.00:44:40
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1448239480.46.0.591822736111.issue25700@psf.upfronthosting.co.za>
In-reply-to
Content
collections.namedtuple documentation has an example about changing the resulting class docstrings:

  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'

This seems to work for the resulting class, but not the field names:

    MsgPacket = namedtuple('MsgPacket', ['sender', 'target', 'sig', 'ser_msg'])
    MsgPacket.__doc__ = '. Message packet format. This is the data added to client queues.'
    MsgPacket.sender.__doc__ = 'Sender public key.'

gives

    Traceback (most recent call last):
      File "C:/UTCloud/UT/DS/S11/server.py", line 42, in <module>
        MsgPacket.sender.__doc__ = 'Sender public key.'
    AttributeError: readonly attribute
History
Date User Action Args
2015-11-23 00:44:40Laur Joostsetrecipients: + Laur Joost, docs@python
2015-11-23 00:44:40Laur Joostsetmessageid: <1448239480.46.0.591822736111.issue25700@psf.upfronthosting.co.za>
2015-11-23 00:44:40Laur Joostlinkissue25700 messages
2015-11-23 00:44:40Laur Joostcreate