numberoverzero / bottom

asyncio-based rfc2812-compliant IRC Client
http://bottom-docs.readthedocs.io
MIT License
74 stars 23 forks source link

Assertion that transport is an instance of asyncio.WriteTransport is not needed #51

Closed nsavch closed 6 years ago

nsavch commented 6 years ago

Bottom's protocol makes an assertion that the transport is an instance of asyncio.WriteTransport (see https://github.com/numberoverzero/bottom/blob/master/bottom/protocol.py#L24 )

This assertion isn't compatible with uvloop library - an alternative event loop with better performance ( https://github.com/MagicStack/uvloop )

Is there a good reason to keep the assertion? I tried to remove it and my program works as expected. Thanks in advance for your help.

numberoverzero commented 6 years ago

Thanks for opening an issue! Yes, that assertion can be removed. I've also started using uvloop for some asyncio work, so I'm glad you found this.

Do you want to open a PR and tag yourself in contributors, or should I take care of it?

nsavch commented 6 years ago

Thanks, I don't think this is big enough to make me a contributor :) Please do it yourself.

numberoverzero commented 6 years ago

Turns out this is for mypy; it was discussed in python/typeshed#1447 but I don't see a resolution. I bumped mypy to 0.521 which fixed one type: ignore comment. For now I'm going to add if MYPY: which should fix the issue for uvloop.

numberoverzero commented 6 years ago

2.1.1 is released, and should fix the issue. Thanks for the report! Hopefully this can be cleaned up as asyncio type annotations improve.