kw param question
kj
no.email at please.post
Mon Aug 3 15:59:23 EDT 2009
I want to write a decorator that, among other things, returns a
function that has one additional keyword parameter, say foo=None.
When I try
def my_decorator(f):
# blah, blah
def wrapper(*p, foo=None, **kw):
x = f(*p, **kw)
if (foo):
# blah, blah
else
# blah blah
return wrapper
...i get a syntax error where it says "foo=None". I get similar
errors with everything else I've tried.
Is is possible to do this in Python?
TIA!
kynn
More information about the Python-list
mailing list