-
-
Notifications
You must be signed in to change notification settings - Fork 88
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 Workers and partial ListenerHolder typing #226
base: master
Are you sure you want to change the base?
Add Workers and partial ListenerHolder typing #226
Conversation
class RSGIWorker(__WorkerConfig): | ||
... | ||
|
||
class WSGIWorker(__WorkerConfig): |
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.
WSGIWorker
doesn't accept websockets_enabled
and opt_enabled
parameters
|
||
class ListenerHolder: | ||
@classmethod | ||
def from_address(cls, bind_addr: str, port: int, backlog: int) -> "ListenerHolder": ... |
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 would add from __future__ import annotations
and remove the string annotation
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.
Is future annotations in re of Protocol?
also unless i'm mistaken, the class method doesn't return the instance?
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.
Yup, ListenerHolder.from_address
returns an instance, see
Line 34 in 348d3c7
pub fn from_address(_cls: &PyType, address: &str, port: u16, backlog: i32) -> PyResult<Self> { |
I commented about __future__
so you can rewrite the upper as:
class ListenerHolder:
@classmethod
def from_address(cls, bind_addr: str, port: int, backlog: int) -> ListenerHolder: ...
ff9588a
to
1814868
Compare
eb5297c
to
8f05250
Compare
No description provided.