def singledispatchmethod(method):
dispatcher = singledispatch(method)<EOL>def wrapper(*args, **kw):<EOL><INDENT>return dispatcher.dispatch(args[<NUM_LIT:1>].__class__)(*args, **kw)<EOL><DEDENT>wrapper.register = dispatcher.register<EOL>update_wrapper(wrapper, dispatcher)<EOL>return wrapper<EOL>
Enable singledispatch for class methods.

See http://stackoverflow.com/a/24602374/274318