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

pyright says that type of cattrs.preconf.json.make_converter is partially unknown

Aperta
#593 3 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
45/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
python
Ambito
tooling

Direzione di ricerca

Start by inspecting Converter.Init and the unstruct_collection_overrides annotation, then trace how cattrs.preconf.json.make_converter() uses it. Compare the annotation with UnstructureHookT and verify that the reported partially unknown type is resolved without changing the converter's behavior.

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

Descrizione

Pyright flags the code below with "Type of "make_converter" is partially unknown".

converter = cattrs.preconf.json.make_converter()

The problem is the type of the parameter unstruct_collection_overrides: Mapping[type, (...) -> Unknown].

Poking around in the cattrs code, this error can be resolved by changing the type of unstruct_collection_overrides in Converter.Init from

unstruct_collection_overrides: Mapping[type, Callable] = {}

to
unstruct_collection_overrides: Mapping[type, UnstructureHookT] = {}

Lingua principale
Python
Stelle
1.1k
Fork
159
Merge medio
12h 21m
PR unite (30g)
6

Guida per i contributori

Apri la guida per i contributori

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-attrs/cattrs

Tutte le issue di python-attrs/cattrs

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.