Is it possible to decorate method arguments? Something like:
class SampleEntity (BaseEntity) :
def someOperation (self, @Param(type="int", unit="MB")i, str) :
pass
Basically I want the developer to be able to specify metadata about the class, properties, methods, arguments etc which I can process later on. For class and methods I could use decorators. So I was wondering how to do it for method arguments.
Thanks,
Litty
No, but in Python 3 you can use annotations.
Annotations can hold any information you want, language doesn’t define what should go there. You can access them with
func.__annotations__dict later.