[Python-Dev] Functools Defaults (was Python-ideas parameter omit) (original) (raw)

Aaron Brady castironpi at comcast.net
Tue May 15 13:52:41 CEST 2007


-----Original Message----- From: Steven Bethard [mailto:steven.bethard at gmail.com] Sent: Tuesday, May 15, 2007 1:54 AM

On 5/15/07, Aaron Brady <castironpi at comcast.net> wrote: 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/?groupid=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.

Code with proposal are in SourceForge [ 1719222 ] new functools.

Python feature

Functools gains a new decorator.

`Defaults' allows its caller to placehold non-None defaults; it becomes unnecessary to know the value a place defaults to.

It might be useful in cases where you want the calling signature to look alike for a group of dispatched functions and the added overhead the decorator adds isn't a problem. But you probably wouldn't want that overhead all the time, so having it as an optional decorator would be good. -Ron Adam

What -do- you think about it?



More information about the Python-Dev mailing list