cloudflare / cloudflare/cloudflare-python
.to_dict() returns object
- Vorherrschende Sprache
- Python
- Sterne
- 506
- Forks
- 148
- Ø Merge
- 3 Std. 15 Min.
- Gemergte PRs (30 T.)
- 1
Beschreibung
### Confirm this is a Python library issue and not an underlying Cloudflare API issue.
- [x] This is an issue with the Python library
### Describe the bug
.to_dict() returns dict[str, object]:
https://github.com/cloudflare/cloudflare-python/blob/475b534aadd740ae087967be82040bf0b365f8b9/src/cloudflare/_models.py#L108
This obviously creates type errors any time a user tries to use any of the values. If possible, the class should be made generic to return a more accurate type. If not, then the type should be dict[str, Any] in order to not create a load of type errors in user's code.
Beitragsleitfaden
Rechercherichtung
Lies src/cloudflare/_models.py um Zeile 108 herum und überprüfe die aktuelle .to_dict()-Annotation sowie deren Aufrufer. Bestimme, ob das Modell einen genaueren generischen Typ bereitstellen kann oder dict[str, Any] verwenden sollte; abgeschlossen ist die Aufgabe, wenn die Typprüfung durch den Benutzer die zurückgegebenen Werte nicht mehr als object meldet.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- python
- Bereich
- api
- Issue-Typ
- Bug
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 45/100