Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #7835 > unrolled thread

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

Started byEthan Furman <ethan@stoneleaf.us>
First post2011-06-17 10:18 -0700
Last post2011-06-17 10:18 -0700
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: How to avoid "()" when writing a decorator accepting optional arguments? Ethan Furman <ethan@stoneleaf.us> - 2011-06-17 10:18 -0700

#7835 — Re: How to avoid "()" when writing a decorator accepting optional arguments?

FromEthan Furman <ethan@stoneleaf.us>
Date2011-06-17 10:18 -0700
SubjectRe: How to avoid "()" when writing a decorator accepting optional arguments?
Message-ID<mailman.81.1308330272.1164.python-list@python.org>
Giampaolo RodolĂ  wrote:
> I've written this decorator to deprecate a function and (optionally)
> provide a callable as replacement

I can see providing the replacement function so that you can say, for 
example, "you are calling a deprecated function -- <function xyz> is the 
replacement".

If your replacement function is drop-in compatible, though, why bother 
with the whole deprecate decorator?  Just drop it in!  :)

~Ethan~

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web