aio-libs / aiodns

Simple DNS resolver for asyncio
https://pypi.python.org/pypi/aiodns
MIT License
532 stars 69 forks source link

aiodns pep484 + mypy support #25

Closed cooperlees closed 7 years ago

cooperlees commented 7 years ago

Is there any plan for PEP 484 type annotation support in aiodns?

PEP 484: https://www.python.org/dev/peps/pep-0484/ mypy: http://mypy-lang.org/

If I were to do the diff, would the PR be accepted?

saghul commented 7 years ago

Hi there! I'm afraid there are no plans, and patches wouldn't be acceptable at this stage because it would mean dropping Python < 3.5 support (AFAIK), which I'm not planning to do at the moment.

ambv commented 7 years ago

@saghul fortunately dropping support for < 3.5 is unnecessary. Since you're still compatible with 2.x, we'll have to use type comments, which are compatible with both versions and are documented in the PEP. This way you could start using Mypy now, and even run it against 2.7, 3.3, 3.4, 3.5, and 3.6 in your Travis runs.

Once the types are there, moving them to be proper annotations once you drop Python 2 support will be very easy. But we don't have to do that yet.

saghul commented 7 years ago

Oh, alright then! Bring them on :-)

cooperlees commented 7 years ago

Working on it: https://github.com/saghul/aiodns/pull/27

saghul commented 7 years ago

Fixed by #27