Aaron Brady wrote:
-----Original Message----- From: Aaron Brady [mailto:castironpi@comcast.net] Sent: Sunday, May 13, 2007 9:28 PM
-----Original Message----- From: python-ideas-bounces@python.org [mailto:python-ideas- bounces@python.org] On Behalf Of Aaron Brady
class GuardDefault: Val= object() def __call__( self, *args, **kwargs ): args=list(args) for i,j in enumerate( args ): if j is GuardDefault.Val: offset= self.callable.func_code.co_argcount-\ len(self.callable.func_defaults) args[i]= self.callable.func_defaults[i-offset] return self.callable( *args,**kwargs ) def __init__( self,callable ): self.callable= callable Do you have any interest in pursuing this?
Actually not too bad for functools. Does this take a proposal? -I- am God-awful at lengthy technical writing.
I suggest you post it on the python-list firsts and see what others think. They may offer alternative ways of doing it that will make it better based on how they will used it. Cheers, Ron
participants (1)
-
Ron Adam