Deprecate usage of annotations as parameter converters
JelleZijlstra opened this issue · 5 comments
JelleZijlstra commented
aiozmq currently inspects annotations on RPC methods and uses them as parameter converters. This makes it hard to use typing on a codebase that uses aiozmq, so we should deprecate and replace this feature.
asvetlov commented
Any ideas for the replacement?
akhilman commented
May be define converters as `rpc.method`` decorator parameters?
wachpwnski commented
I take it this is why when I use annotations on the rpc.method
I get an exception?
import aiozmq.rpc
from typing import Any
@aiozmq.rpc.method
async def create(self, meta: Any) -> int:
...
aiozmq.rpc.base.ParametersError: Invalid value for argument 'meta': TypeError('Cannot instantiate typing.Any')
JelleZijlstra commented
Yes.
JelleZijlstra commented
Done in the latest release.