dynamically modify help text

Aahz aahz at pythoncraft.com
Wed Jun 30 12:38:40 EDT 2010


In article <mailman.2338.1277812368.32709.python-list at python.org>,
Thomas Jollans  <thomas at jollans.com> wrote:
>
>% python2.6
>Python 2.6.5+ (release26-maint, Jun 28 2010, 19:46:36)
>[GCC 4.4.4] on linux2
>Type "help", "copyright", "credits" or "license" for more information.
>>>> class OLD: pass
>...
>>>> class NEW(object): pass
>...
>>>> OLD.__doc__ = "foo"
>>>> NEW.__doc__ = "bar"
>Traceback (most recent call last):
>  File "<stdin>", line 1, in <module>
>AttributeError: attribute '__doc__' of 'type' objects is not writable
>>>>

I'd argue that's a bug -- feel free to file one.  I think this might
even be fixable in 2.7.1.
-- 
Aahz (aahz at pythoncraft.com)           <*>         http://www.pythoncraft.com/

"If you don't know what your program is supposed to do, you'd better not
start writing it."  --Dijkstra



More information about the Python-list mailing list