F
Fernando Rodriguez
Hi,
What's the syntax to add an attribute to a function form the function body?
For example, instead of doing:
def fn():
return 1
fn.error = "Error message"
print fn.error
I'd like to do something like this:
def fn():
error = "Error message"
return 1
print fn.error
How can I do this? O
TIA
What's the syntax to add an attribute to a function form the function body?
For example, instead of doing:
def fn():
return 1
fn.error = "Error message"
print fn.error
I'd like to do something like this:
def fn():
error = "Error message"
return 1
print fn.error
How can I do this? O
TIA