Using decorators with argument in Python
Ian Kelly
ian.g.kelly at gmail.com
Wed Jun 29 15:29:42 EDT 2011
On Wed, Jun 29, 2011 at 1:30 PM, Ethan Furman <ethan at stoneleaf.us> wrote:
> How about just having one bit of code that works either way?
How would you adapt that code if you wanted to be able to decorate a
function that takes arguments?
This also won't work if the argument to the decorator is itself a
callable, such as in the OP's example.
More information about the Python-list
mailing list