Type compatibility with `h11._headers.Header`
Đánh giá
- Độ khó
- 1/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 48/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- python
- Lĩnh vực
- networking
Hướng nghiên cứu
Start in src/wsproto/typing.py and inspect how the Headers alias is defined. Compare it with h11._headers.Headers from version 0.13.0, then verify that the reported mypy error is resolved and that existing checks still pass. Done means wsproto.Header is type-compatible with h11 headers.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
At the moment, the wsproto.typing.Header type is not compatible with h11._headers.Header which is defined as the following, starting with version 0.13.0:
class Headers(Sequence[Tuple[bytes, bytes]]):
[...]
The following patch might provide this compatibility:
diff --git a/src/wsproto/typing.py b/src/wsproto/typing.py
index a44b27e..1786501 100644
--- a/src/wsproto/typing.py
+++ b/src/wsproto/typing.py
@@ -1,3 +1,3 @@
-from typing import List, Tuple
+from typing import Sequence, Tuple
-Headers = List[Tuple[bytes, bytes]]
+Headers = Sequence[Tuple[bytes, bytes]]
This would fix mypy errors such as:
error: Argument "headers" to "initiate_upgrade_connection" of "WSConnection" has incompatible type "Headers"; expected "List[Tuple[bytes, bytes]]" [arg-type]
Would that make sense? I can make a PR if necessary.
- Ngôn ngữ chính
- Python
- Star
- 303
- Fork
- 61
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của python-hyper/wsproto
-
CompressionĐang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
python-hyper/wsproto#199 · 5 bình luận ·
-
Attempt to close with local-only codes (e.g. 1006) results in normal close (1000)Có thể đã có người làm @ShipItAndPray đã nhận 180 ngày trước. Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 38/100
python-hyper/wsproto#182 ·
Tất cả issue của python-hyper/wsproto
Issue tương tự
-
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 85/100
WLAN-Pi/wlanpi-profiler#341 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Memory leak: the shared `validation_aborted_error` keeps every traceback it is raised throughCó thể đã có người làm @Fire162 đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
graphql-python/graphql-core#287 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 67/100
roman-corgi/ctc-dip#160 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
type-bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
render_findings.py reads and writes in the host's default encoding, so findings.html breaks on a cp1252 Windows hostCó thể đã có người làm @Aaqibhafeezkhan đã nhận hôm nay. Đang mởbug good first issue mentored python size: XS up-for-grabs
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
dheerajjha/mcp-migrate#366 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày