[issue25700] namedtuple documentation

2015-11-22 Thread Laur Joost

New submission from Laur Joost:

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 
MsgPacket.sender.__doc__ = 'Sender public key.'
AttributeError: readonly attribute

--
assignee: docs@python
components: Documentation
messages: 255121
nosy: Laur Joost, docs@python
priority: normal
severity: normal
status: open
title: namedtuple documentation
versions: Python 3.5

___
Python tracker 
<http://bugs.python.org/issue25700>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue25700] namedtuple documentation

2015-11-22 Thread Laur Joost

Laur Joost added the comment:

Did my testing on 3.4.3 (other computer). My apologies.

--
resolution:  -> not a bug
status: open -> closed

___
Python tracker 
<http://bugs.python.org/issue25700>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com