1 Apr
2016
1 Apr
'16
9:08 p.m.
Function decorators
There are decorators that return a callable that not calls the function that was given as an argument, but also do some other things, and therefore change the behaviour of that function.
So instead of
a = Char(length=10, value='empty')
you want
@Char(length=10) a = 'empty'
?
If possible, yes. So that there is a standardized way to access changing variables, or to put limits on the content of the variable, similar to the @accepts and @produces decorators that are seen here ( https://wiki.python.org/moin/PythonDecoratorLibrary#Type_Enforcement_.28acce... )