Skip to content

Fix return type of requests.utils.select_proxy#15777

Closed
mrhx01 wants to merge 5 commits into
python:mainfrom
mrhx01:main
Closed

Fix return type of requests.utils.select_proxy#15777
mrhx01 wants to merge 5 commits into
python:mainfrom
mrhx01:main

Conversation

@mrhx01
Copy link
Copy Markdown
Contributor

@mrhx01 mrhx01 commented May 12, 2026

Fix type annotations in requests.utils.

This PR fixes two inconsistencies between the runtime implementation and the typeshed stubs:

  1. select_proxy may return None when no matching proxy is found, so the return type should be str | None.

  2. should_bypass_proxies accepts str | None for the no_proxy parameter in the runtime implementation, but the stub currently annotates it as Iterable[str] | None.

These changes align the stubs with the actual runtime behavior.

@github-actions

This comment has been minimized.

@github-actions
Copy link
Copy Markdown
Contributor

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

@srittau
Copy link
Copy Markdown
Collaborator

srittau commented May 12, 2026

This is a no-op now. Thanks again!

@srittau srittau closed this May 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants