[Python-Dev] Writable __doc__

Sreenivas Reddy T thatiparthysreenivas at gmail.com
Thu Jan 19 05:52:08 CET 2012


this is happening on python 2.6 too.

Python 2.6.5 (r265:79063, Apr 16 2010, 13:57:41)
[GCC 4.4.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> class Test(type):
...       __doc__=
  File "<stdin>", line 2
    __doc__=
           ^
SyntaxError: invalid syntax
>>> class Test(type):
...       __doc__='asasdas'
...
>>>
>>> Test.__doc__='sadfsdff'
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: attribute '__doc__' of 'type' objects is not writable
>>> type(Test)
<type 'type'>
>>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20120119/e273ad7b/attachment.html>


More information about the Python-Dev mailing list