Update Route.respond json type hint to Any to match HTTPX#284
Update Route.respond json type hint to Any to match HTTPX#284JacobHayes wants to merge 2 commits intolundberg:masterfrom
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #284 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 22 22
Lines 2915 2915
Branches 192 192
=========================================
Hits 2915 2915 ☔ View full report in Codecov by Sentry. |
|
@JacobHayes, new discussions regarding this has come up in #290 and we're leaning towards typing json as |
4a3a22c to
26e41e2
Compare
|
Yup, that should make pyright happy too! Just updated this PR to use |
26e41e2 to
50e07ef
Compare
Signed-off-by: Jacob Hayes <jrh@jacobhayes.dev>
50e07ef to
7ec8ab7
Compare
|
Just a ping. Hoping this can get in so Pyright will get off my back. :P |
Co-authored-by: Mike Nerone <mike@nerone.org>
|
FYI @lundberg I'm guessing the |
The
jsonparameter toRoute.respondis missing hints for theListandDictelements, which makespyrightsad in strict mode:This PR just adds the hints for the elements. I think python's
json.dumpwill accept arbitrary key types, but the JSON spec only defines strings so I usedDict[str, ...]. I'm happy to change that toAnyif you'd prefer.Thanks for the helpful library!