Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add PEP484 Typing + typing to setup.py #27

Merged
merged 1 commit into from Jan 5, 2017
Merged

Add PEP484 Typing + typing to setup.py #27

merged 1 commit into from Jan 5, 2017

Conversation

cooperlees
Copy link
Contributor

  • Add in Py2/3 compatible PEP484 typing
  • Add in typing as a install_requires in setup.py

self._channel.cancel()

# TODO: Workout socket fd type
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it will be an int

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will change - Wasen't sure that it would always be an int

@@ -103,7 +119,9 @@ def _sock_state_cb(self, fd, readable, writable):
self._timer.cancel()
self._timer = None

# TODO: Workout socket fd type
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

int

@@ -6,7 +6,14 @@
import trollius as asyncio
import pycares

from . import error
from typing import (
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for my ignorance, but why are these needed if we are not really using them (just in comments) ?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Those comments are evaluated by the tools performing the type checking (like mypy).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

)

# TODO: Work out mypy no attribute error
from . import error # type: ignore
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this import needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems to be a mypy bug with this kind of import

  • The import itself was already in the code

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, right!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cooperlees What was the issue that you encountered? Seems to work fine with Python3 mypy, so I guess that this workaround should be removed.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#75

@cooperlees
Copy link
Contributor Author

Fixes coming

@saghul saghul merged commit 896dcf1 into saghul:master Jan 5, 2017
@saghul
Copy link
Owner

saghul commented Jan 5, 2017

Great work, cheers!

@cooperlees
Copy link
Contributor Author

No worries. Thanks 👍

@cooperlees cooperlees deleted the add_typing branch January 5, 2017 21:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants