[Patches] [ python-Patches-1161819 ] Add method to function objects to simplify decoration

SourceForge.net noreply at sourceforge.net
Sat Mar 12 05:21:09 CET 2005


Patches item #1161819, was opened at 2005-03-12 14:21
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1161819&group_id=5470

Category: Core (C code)
Group: Python 2.5
Status: Open
Resolution: None
Priority: 5
Submitted By: Nick Coghlan (ncoghlan)
Assigned to: Nobody/Anonymous (nobody)
Summary: Add method to function objects to simplify decoration

Initial Comment:
When decorating a function without changing the signature, it 
is generally appropriate to preserve the metadata from original 
function. 
 
This currently involves copying the docstring and name and 
updating the function attribute dict manually. 
 
This patch adds an "update_meta" method to function objects 
which modifies the current function to masquerade as the 
original function. 
 
Test & documentation patches still to come. (Although the 
docstring text could also be used for the documentation) 
 

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1161819&group_id=5470


More information about the Patches mailing list