Skip to content

Accept any sequence of header pairs, not just list - #204

Open
gyanu2507 wants to merge 2 commits into
python-hyper:mainfrom
gyanu2507:headers-as-sequence
Open

Accept any sequence of header pairs, not just list#204
gyanu2507 wants to merge 2 commits into
python-hyper:mainfrom
gyanu2507:headers-as-sequence

Conversation

@gyanu2507

Copy link
Copy Markdown

We only iterate header pairs. Typing them as list meant a tuple or h11.Headers needed a pointless list(...) copy.

Fixes #173

Callers shouldn't have to copy a tuple or h11 headers object into a list.
Comment thread src/wsproto/typing.py Outdated
@@ -1,3 +1,3 @@
from __future__ import annotations
from typing import Sequence

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I believe this is already deprecated since Python 3.9 - please use collections to import the related types. See https://docs.python.org/3/library/typing.html#deprecation-timeline-of-major-features.

注册 for free to join this conversation on GitHub. Already have an account? 登录 to comment

标签

None yet

项目

None yet

Development

Successfully merging this pull request may close these issues.

Type compatibility with h11._headers.Header

2 participants