Translating the following Decorator functions
Posted: Sun Mar 09, 2014 4:57 pm
In Python
@A
@B
def func:
would become func=A( ) (B ( ) (func) )
So the following definitions
would become request("GET", "*/integer") (response("%d") (portRead())
My question
1)is request() and response () functions? I couldn't find their function definition anywhere.
To me, seem like they are more like Http REST calls rather function. How would that relate to the template decorator function I listed above?
2)_portRead_ is nothing there except raise exception. Is that right?
@A
@B
def func:
would become func=A( ) (B ( ) (func) )
So the following definitions
Code: Select all
@request("GET", "*/integer")
@response("%d")
def portRead(self):
return self.__portRead__()
def __portRead__(self):
raise NotImplementedError
My question
1)is request() and response () functions? I couldn't find their function definition anywhere.
To me, seem like they are more like Http REST calls rather function. How would that relate to the template decorator function I listed above?
2)_portRead_ is nothing there except raise exception. Is that right?