Are decorators really that different from metaclasses...

Arthur ajsiegel at optonline.com
Thu Aug 26 16:40:18 CEST 2004


On Thu, 26 Aug 2004 09:31:55 -0400, Paul Morrow <pm_mon at yahoo.com>
wrote:

>
>Currently, you can change a doc string outside of a function, by 
>modifying the function's __doc__ attribute
>
>   >>> def foo():
>   ...     """ I am foo """
>   ...
>   >>> foo.__doc__
>   ' I am foo '
>   >>> foo.__doc__ = foo.__doc__ + 'indeed'
>   >>> foo.__doc__
>   ' I am foo indeed'
>   >>>
>
>IMO, to change it inside of a function def should be (but isn't) as easy 
>as...
>
>   >>> def foo():
>   ...     """ I am foo """
>   ...     __doc__ = __doc__ + 'indeed'
>
>Paul

Yes.  Not only do I follow, but I think we came to exactly the same
place, from very different directions, and coming from what I sense is
very different backgrounds.

Its just that I don't think many others seem to find that as
interesting as I happen to.

Hopefully, for good enough reasons.

Art

>
>




More information about the Python-list mailing list