A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2005-March/052160.html below:

[Python-Dev] func.update_meta (was: @deprecated)

[Python-Dev] func.update_meta (was: @deprecated) [Python-Dev] func.update_meta (was: @deprecated)Nick Coghlan ncoghlan at iinet.net.au
Mon Mar 14 14:33:35 CET 2005
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   |   ncoghlan at email.com   |   Brisbane, Australia
---------------------------------------------------------------
             http://boredomandlaziness.skystorm.net
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4