bastimeyer · GitHub

urllib3 has inline type annotations

@bastimeyer

- Fix various typing issues caused by the switch
  to requests' new inline typing annotations
- Simplify http.pyi based on requests' TypedDict typing data
Use the right return type for `request()` and various HTTP-verb methods
based on the `schema` input parameter: instead of returning `Any`
in all cases, return `requests.Response` if no `schema` was set.
- Remove incorrect classvar `params` type override
- Define `request()` keyword arguments explicitly
- Rename internal `retries` variable to `attempt`,
  to make it not clash with the keyword argument
- Fix headers/params override from optional `session` argument
- Add tests for HTTP-verb methods and the `session` argument,
  and update the read-timeout test

@bastimeyer

@bastimeyer

@bastimeyer

bastimeyer deleted the typing/no-stubs-urllib3-requests branch

May 13, 2026 17:26

Merged

Read the original on github.com ↗