Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

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

Aperta Adatta ai principianti
#799 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
76/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
python
Ambito
api, backend

Direzione di ricerca

Leggi caldav/collection.py nella sezione intorno a Calendar.multiget() e confronta la sua annotazione con quella di search() o get_object_by_uid(). Poi esamina caldav/davclient.py nella sezione intorno ai costruttori sincroni e asincroni e alla gestione delle password. Aggiorna in modo coerente i tipi pubblici e controlla i test pertinenti di tipizzazione e del client; il lavoro è concluso quando multiget() asincrono è rappresentato come una funzione che restituisce una coroutine ed entrambi i client espongono le password come str.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.

Lingua principale
Python
Stelle
412
Fork
113
Merge medio
11h 37m
PR unite (30g)
50

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di python-caldav/caldav

Tutte le issue di python-caldav/caldav

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.