GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — Fix all typing issues by Kludex · Pull Request #134 · MagicStack/httptools Conversation
|
| - on_message_begin() | ||
| - on_url(url: bytes) | ||
| - on_header(name: bytes, value: bytes) | ||
| - on_headers_complete() | ||
| - on_body(body: bytes) | ||
| - on_message_complete() | ||
| - on_chunk_header() | ||
| - on_chunk_complete() | ||
| - on_status(status: bytes) |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
This is not needed. Implementers can follow the protocol.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| - on_chunk_header() | ||
| - on_chunk_complete() | ||
| - on_status(status: bytes) | ||
| def __init__(self, protocol: HTTPProtocol | object) -> None: |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
object is less permissive than Any.
Python still doesn't support "not required class method protocol": https://discuss.python.org/t/discussion-optional-class-and-protocol-fields-and-methods
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| protocol (HTTPProtocol): Callback interface for the parser. | ||
| """ | ||
|
|
||
| def set_dangerous_leniencies( |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
This was missing.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| ... | ||
|
|
||
| def feed_data(self, data: Union[bytes, bytearray, memoryview, array]) -> None: | ||
| def feed_data(self, data: Union[bytes, bytearray, memoryview, array[int]]) -> None: |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
array is a Generic.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| def on_message_begin(self) -> None: ... | ||
| def on_url(self, url: bytes) -> None: ... | ||
| def on_header(self, name: bytes, value: bytes) -> None: ... | ||
| def on_headers_complete(self) -> None: ... | ||
| def on_body(self, body: bytes) -> None: ... | ||
| def on_message_complete(self) -> None: ... | ||
| def on_chunk_header(self) -> None: ... | ||
| def on_chunk_complete(self) -> None: ... | ||
| def on_status(self, status: bytes) -> None: ... |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Missing self.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| Returns an instance of ``httptools.URL`` class with the | ||
| following attributes: | ||
|
|
||
| - schema: bytes | ||
| - host: bytes | ||
| - port: int | ||
| - path: bytes | ||
| - query: bytes | ||
| - fragment: bytes | ||
| - userinfo: bytes |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Irrelevant. The URL is defined above.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| __all__ = ( | ||
| # protocol | ||
| "HTTPProtocol", | ||
| # parser | ||
| "HttpParser", | ||
| "HttpRequestParser", | ||
| "HttpResponseParser", | ||
| # errors | ||
| "HttpParserError", | ||
| "HttpParserCallbackError", | ||
| "HttpParserInvalidStatusError", | ||
| "HttpParserInvalidMethodError", | ||
| "HttpParserInvalidURLError", | ||
| "HttpParserUpgrade", | ||
| # url_parser | ||
| "parse_url", | ||
| ) |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Proper definition.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
I've dropped the |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
I've tested this on uvicorn, it works like a charm. It would be nice to add a type checker in this repository. EDIT: I meant the typing... 😅 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Thank you! Looks there's an error: Let me add a CI workflow to check typing. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Then it seems the issue is that the I'm on a plane. I'll fix this tomorrow. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
It seems I've added the type checker to the pipeline, but feel free to tweak whatever you want. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Changes ======= * Add http-parser and llhttp licenses into the wheels (MagicStack#135) (by @justeph in c398a15) * Mark cython module as free-threading compatible (MagicStack#139) (by @kumaraditya303 in 28d1db1) * Fix all typing issues (MagicStack#134) (by @Kludex in a9bda0e) * Bump llhttp to 9.4.1 (MagicStack#145) (by @fantix in e3e8d71) * Security: fix URL truncation issue (MagicStack#144) (by @fantix in a0283f0 for MagicStack#142) * Allow building with latest setuptools (MagicStack#138) (by @OldManYellsAtCloud in c403ad1)
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.