Eric Nieuwland wrote:
Neat! But please add something to the __doc__ so we can also see it was changed. E.g.
self.__doc__ = other.__doc__ + os.linesep + "*** deprecated ***"

Decorators that alter the signature, or wish to change the docstring can make their modifications after copying from the original (or simply not copy from the original in the first place). E.g:


def deprecated(orig):
  def f(*args, **kwds):
    #Emit warning here
    return orig(*args, **kwds)
  f.update_meta(orig)
  f.__doc__ = "*** Deprecated *** " + f.__doc__
  return f

Any such changes are outside the purview of a metadata transfer method, though, since they're highly decorator dependent.

Cheers,
Nick.

--
Nick Coghlan   |   [EMAIL PROTECTED]   |   Brisbane, Australia
---------------------------------------------------------------
            http://boredomandlaziness.skystorm.net
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to