aio-libs/aiozmq

Deprecate usage of annotations as parameter converters

JelleZijlstra opened this issue · 5 comments

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')

Done in the latest release.