[Python-ideas] Before and after the colon in funciton defs.

Nick Coghlan ncoghlan at gmail.com
Mon Sep 19 11:35:56 CEST 2011

On Mon, Sep 19, 2011 at 5:44 PM, David Townshend <aquavitae69 at gmail.com> wrote:
> I think something similar could be achieved with annotations, as in
> the following example.
> This is incomplete, and probably full of errors, but it gives the idea.

Proposals that are uglier than the default argument hack itself (and I
put both annotations+decorator and the '@+' idea in that category)
just aren't worth the hassle. The *only* change even potentially worth
making in this area would be one that:
- looks good (i.e. is easy to read)
- is easy to remember and write
- doesn't hurt call time performance
- addresses all the default argument hack use cases
- doesn't have the downside of altering the function's externally
visible signature

My initialised locals idea *might* qualify (although I've yet to see
anyone make a serious attempt at poking holes in it, so I'm not
convinced of that), but the other suggestions in this thread haven't
really offered anything to recommend them over the existing approach.


Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia

More information about the Python-ideas mailing list