-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
10146 type annotate twisted.application.reactors and twisted.application.strports #1560
10146 type annotate twisted.application.reactors and twisted.application.strports #1560
Conversation
13e4925
to
ab85301
Compare
ModuleNotFoundError: No module named 'twisted.interfaces' You want |
ab85301
to
5c38f85
Compare
@@ -53,23 +54,23 @@ class Reactor: | |||
the install callable is an attribute. | |||
""" | |||
|
|||
def __init__(self, shortName, moduleName, description): | |||
def __init__(self, shortName: str, moduleName: str, description: str): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this have -> None
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nope, __init__
gains them by default
def _getReactor() -> interfaces.IReactorCore: | ||
from twisted.internet import reactor | ||
|
||
return cast(interfaces.IReactorCore, reactor) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm pretty sure we're going to need to add a public getInstalledReactor()
callable like this, because of this casting requirement, so clients don't have to add this in every project.
@@ -198,7 +211,7 @@ def getPlugins(interface, package=None): | |||
@return: An iterator of plugins. | |||
""" | |||
if package is None: | |||
import twisted.plugins as package | |||
package = _pluginsPackage() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm curious what this change does
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It works around the redefinition
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good
Scope and purpose
because they are the smallest modules
Contributor Checklist:
tox -e lint
to format my patch to meet the Twisted Coding Standard#
character).review
to the keywords field in Trac, and putting a link to this PR in the comment; it shows up in https://twisted.reviews/ now.twisted/twisted-contributors
teams to the PRReviewers
.The first line is automatically generated by GitHub based on PR ID and branch name.
The other lines generated by GitHub should be replaced.