[Doc-SIG] suggestions for a PEP

Edward Welbourne Edward Welbourne <eddy@chaos.org.uk>
Thu, 15 Mar 2001 19:39:16 +0000 (GMT)

Tony and Edward said:
>> Then assign them. __docs__ is a perfectly valid "slot" to assign to (and
>> is the precursor to the whole idea of function values - see the relevant
>> PEP).
> I didn't think this was possible, because the following fails::
>   B.f.__doc__ = A.f.__doc__
> But really you have to do this:
>   B.f.im_func.__doc__ = A.f.__doc__

erm ...

Python 1.5.2 (#5, Oct  4 1999, 13:36:16)  [GCC] on linux2
Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam
>>> def hello(there): return there
>>> hello.__doc__ = 'hello there'
>>> hello.__doc__
'hello there'

if it fails in 2.*, eek !

(Sorry if this has already been said in one of the other
thirty-something e-mails I've yet to reach in my in-box, but I'll have
forgotten it by the time I get through them.)

"There arises from a bad and unapt formation of words
 a wonderful obstruction to the mind."  - Francis Bacon