[Python-ideas] parameter omit

Steven Bethard steven.bethard at gmail.com
Tue May 15 08:53:46 CEST 2007


On 5/15/07, Aaron Brady <castironpi at comcast.net> wrote:
> > -----Original Message-----
> > From: Aaron Brady [mailto:castironpi at comcast.net]
> > Sent: Sunday, May 13, 2007 9:28 PM
> >
> > > -----Original Message-----
> > > From: python-ideas-bounces at python.org [mailto:python-ideas-
> > > bounces at 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.

You might be able to get away without a PEP, but you'll definitely
need to post an implementation patch to the bug tracker
(http://sourceforge.net/tracker/?group_id=5470&atid=105470).  Once
you've posted your implementation, you should send an email to
python-dev asking folks what they think about it.  Be sure to give
some code examples that using this decorator would simplify.

STeVe
-- 
I'm not *in*-sane. Indeed, I am so far *out* of sane that you appear a
tiny blip on the distant coast of sanity.
        --- Bucky Katt, Get Fuzzy



More information about the Python-ideas mailing list