You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Is proxy_bypass_environment intentionally undocumented? #145331
I'm working through some typing issues in Requests and noticed pyright getting tripped up on proxy_bypass_environment. It's been used inside Requests for ~10 years with the assumption it's a publicly available interface. Given it's not documented (and therefore not typed in typeshed), I want to better understand its status.
Is its omission from the docs intentional or an oversight? (Or a third option: I'm just missing where it is in the docs 😅 but I don't see it here for any supported Python version.)
For context on why we use it directly: Requests patches its own version of proxy_bypass_registry to avoid DNS lookups. That behavior made its way into CPython in 3.13 via #115210. We'll need to maintain our shim until Python 3.12 support is dropped, so we still call proxy_bypass_environment directly. I wanted to get clarification on its public API status (or lack thereof) in writing before we suppress the type error.
I should have done a bit more digging before I opened this. It does look like there was an __all__ declaration as far back as Python 2.7 that predates the usage in Requests. This was likely an oversight when the PR was reviewed. I'll close this since the intent is clear for proxy_bypass, proxy_bypass_environment and proxy_bypass_registry to not be used outside of urllib.
Activity
nateprewitt commentedon Feb 27, 2026
I should have done a bit more digging before I opened this. It does look like there was an
__all__declaration as far back as Python 2.7 that predates the usage in Requests. This was likely an oversight when the PR was reviewed. I'll close this since the intent is clear forproxy_bypass,proxy_bypass_environmentandproxy_bypass_registryto not be used outside of urllib.