How to avoid "()" when writing a decorator accepting optional arguments?

bruno.desthuilliers at gmail.com bruno.desthuilliers at gmail.com
Fri Jun 17 10:45:31 EDT 2011


On Jun 17, 3:53 pm, Ian Kelly <ian.g.ke... at gmail.com> wrote:
>
> That works, but I would be concerned about forgetting to specify the
> argument by keyword

(snip funny side effect description)

>  Also, as in my suggestion, it doesn't seem
> like a big improvement to have to type out "replacement=" when you
> need the replacement function just to avoid typing "()" when you
> don't.


I wholefully agree with you on both points. FWIW, it was just for the
sake of being technically correct which, as everyone should know, is
"the best kind of correct"), not about being practically helpful in
anyway <g>




More information about the Python-list mailing list