aiostream icon indicating copy to clipboard operation
aiostream copied to clipboard

MyPy type annotations

Open graingert opened this issue 6 years ago • 1 comments

This library is very functional and has an emphasis on composition - type annotations with generics would make using it much more robust

graingert avatar Jan 03 '19 10:01 graingert

Hi @graingert, and thanks for creating this issue!

I fully agree with your point. I don't have time to dive into mypy and type annotations at the moment, but it definitely is on the todo list :)

vxgmichel avatar Jan 10 '19 18:01 vxgmichel

Hi @vxgmichel! I know it doesn't contribute much value, but I hope you might accept my +1 for this feature request.

I permanently use strict type checking because it allows me to catch errors before I even run the code. It also serves as a very, very effective form of documentation because I often know what I want, and I can work out what to provide based on the type hints.

While I'm quite familiar with RxJS, I find myself moving very slowly with aiostream—and a big part of this is the missing type hints.

I've tried to progress by adding type annotations to the existing aiostream codebase locally, but some of the parts (like @operator) are too difficult for me to understand what is happening.

Lx avatar May 20 '23 07:05 Lx

Hi @Lx, I finally took the time to type the code base: https://github.com/vxgmichel/aiostream/pull/84

All of the aiostream package is strictly checked, except for aiostream.test_utils. There are also a couple of type: ignore here and there.

Could you give it a try and let me know if it helps with you usage? Thanks :)

vxgmichel avatar Jun 09 '23 15:06 vxgmichel

Hi! I am also interested in type annotations for this project (and actually got a couple of hours into adding them without noticing this branch).

It looks like you've got it solved, but if you need an extra pair of hands I'm happy to help.

javajawa avatar Jun 18 '23 12:06 javajawa

Hi @javajawa

if you need an extra pair of hands I'm happy to help.

Oh that's so nice thank you ! Would you mind trying #84 and see if it works correctly with your own project? I had to go heavy-handed with the annotations so it's very likely I missed something.

vxgmichel avatar Jun 19 '23 07:06 vxgmichel