G
Gerardo Herzig
Hi all. Im reading the Gido's aproach using decorators at
http://www.artima.com/weblogs/viewpost.jsp?thread=101605
It looks good to me, but the examples shows the functionality using
functions.
Now, when i try to give this decorator into a method, if i try the
class test(object):
@multimethod(...)
def met(self, ...):
The multimethod decorator needs the types of the arguments, and, if the
met method requires self as the first argument, the multimethod should
look like
@multimethod(self.__class__, bla, ble) or some like that...
Now i know that im wrong, because i have this error
So what would be the first argument to @multimethod??
Thanks!!
Gerardo
http://www.artima.com/weblogs/viewpost.jsp?thread=101605
It looks good to me, but the examples shows the functionality using
functions.
Now, when i try to give this decorator into a method, if i try the
class test(object):
@multimethod(...)
def met(self, ...):
The multimethod decorator needs the types of the arguments, and, if the
met method requires self as the first argument, the multimethod should
look like
@multimethod(self.__class__, bla, ble) or some like that...
Now i know that im wrong, because i have this error
>@multimethod(self.__class__)
>NameError: name 'self' is not defined
So what would be the first argument to @multimethod??
Thanks!!
Gerardo