You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a simple decorator that just sets an attribute on a function and returns it. The closest I got to checking this is creating a subclass of Callable and adding the attribute to it:
fromtypingimportCallable, castclassRemoteCallable(Callable):
rpc_name: str=Nonedefremote(f: Callable) ->RemoteCallable:
''' Decorator marking a function as callable via the RPC system. '''f=cast(RemoteCallable, f)
f.rpc_name=f.__name__returnf
However, this fails with rpc.py:3: error: Invalid base class. What can I do?
The text was updated successfully, but these errors were encountered:
This isn't currently supported yet, but @ilevkivskyi came up with an elegant approach recently so we can support it; see #2087. Closing as a duplicate of that issue.
I have a simple decorator that just sets an attribute on a function and returns it. The closest I got to checking this is creating a subclass of
Callable
and adding the attribute to it:However, this fails with
rpc.py:3: error: Invalid base class
. What can I do?The text was updated successfully, but these errors were encountered: