Commit Detail
Commit 03281a0
Python: `Response`: Handle instance json method (#4867) The JavaScript `json` method is both a static method and an instance method on `Response`. Doing this in Python is awkward and doesn't work correctly with static type checkers. To maintain compatibility, I made `json()` work at runtime as a static method or an instance method. It will only type check when used as an instance method. I added a new `from_json()` method which is static only and will work as expected with mypy. I also made as many places as possible return Response instead of FetchResponse.
Files changed
2 files changed~2 modified