h2non / paco

Small utility library for coroutine-driven asynchronous generic programming in Python
http://paco.rtfd.io
MIT License
202 stars 13 forks source link

Typing support #47

Open sobolevn opened 4 years ago

sobolevn commented 4 years ago

Hi!

Thanks a lot for building this library. It looks awesome and I cannot imagine how people live without it.

The only missing feature for me are type annotations. That can be added rather easily. Currently we are working on async functions support for returns library: https://github.com/dry-python/returns/issues/274

It would be awesome if we can use these two together. But, one of the most important features of our library is full mypy-compatible typing.

I would love to help and add types if you don't mind!

h2non commented 4 years ago

I think that's interesting and perfectly doable since PEP484 introduced optional syntactical support for type annotations.

The only downside is perhaps the Python 3.4 should be deprecated and package syntax should embrace async/await operators, but I don't any problem these days.

I'm open to explore and bring that feature into the package, as long as there is no opinionated style or dependencies by doing so.

sobolevn commented 4 years ago

as long as there is no opinionated style or dependencies by doing so

There might be some @oveload and typevars here and there. If that's a problem, we can always move this code to .pyi file. And yes, python3.4 should be deprecated. It is not officially supported anymore.