aiozmq
aiozmq copied to clipboard
Deprecate usage of annotations as parameter converters
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.
Any ideas for the replacement?
May be define converters as `rpc.method`` decorator parameters?
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')
Yes.
Done in the latest release.