Skip to content

Is proxy_bypass_environment intentionally undocumented? #145331

Closed as not planned
Closed as not planned

Description

@nateprewitt

Documentation

Hi there,

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.

Activity

  1. added
    docs
    on Feb 27, 2026
  2. nateprewitt commented on Feb 27, 2026

    @nateprewitt
    Author

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    docs

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions