Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Typing nits: Calendar.multiget() annotation, and DAVClient.password type differs between sync and async

Đang mở Phù hợp với người mới
#799 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
76/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
python
Lĩnh vực
api, backend

Hướng nghiên cứu

Đọc caldav/collection.py quanh Calendar.multiget() và so sánh chú thích kiểu của nó với search() hoặc get_object_by_uid(). Sau đó kiểm tra caldav/davclient.py quanh các hàm khởi tạo đồng bộ và bất đồng bộ cũng như phần xử lý mật khẩu. Cập nhật nhất quán các kiểu công khai và kiểm tra các bài kiểm thử liên quan đến kiểu và client; hoàn tất khi multiget() bất đồng bộ được biểu diễn là trả về một coroutine và cả hai client đều công khai mật khẩu dưới dạng str.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Disclaimer: AI-generated text below the line, generated by Claude Opus 5.5 while writing the CalDAV backend for calendaring, from the prompt:

file the ugs (sic) found


Two small inconsistencies, both found while wrapping caldav in a typed sync/async layer. Low priority; neither breaks anything at runtime today.

  1. Calendar.multiget() is annotated -> Iterable[_CC], but returns a coroutine to an async client (caldav/collection.py, multiget). Its siblings (search(), get_object_by_uid(), ...) say "list[_CC] | Coroutine[Any, Any, list[_CC]]"; multiget() returns self._async_multiget_objects(...) for an async client but its annotation does not admit it, so a type checker accepts for obj in calendar.multiget(urls) on an async client, which then iterates a coroutine. Fix: the same X | Coroutine[...] annotation as the others.

  2. DAVClient.password is bytes, AsyncDAVClient.password is str. The sync constructor encodes a str password to UTF-8 (caldav/davclient.py, around line 330); the async one keeps it as given. The sync client decodes it again before building the auth object, so authentication works in both modes, but the public attribute's type depends on the mode: code reading client.password (a test, or a wrapper that hands the client to something else) has to accept both. Fix: keep it a str in both, and encode only where bytes are needed, if anywhere.

Ngôn ngữ chính
Python
Star
412
Fork
113
Merge trung bình
11 giờ 37 phút
Pull request đã merge (30 ngày)
50

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của python-caldav/caldav

Tất cả issue của python-caldav/caldav

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.