Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More public API tightening #1065

Merged
merged 1 commit into from
Jul 17, 2020
Merged

More public API tightening #1065

merged 1 commit into from
Jul 17, 2020

Conversation

tomchristie
Copy link
Member

Move the following into private API space...

  • .get_proxy_map
  • .init_transport
  • .init_proxy_transport
  • .proxies
  • .transport

I believe I omitted these in #997 because some of the proxy test cases call into them, which meant these were less clear than the cases in that PR, but I figure we really do want them private in any case, and if we've got some test cases that track a bit of internal state, then well okay, let's live with that for now.

There's also a few attributes that are set in BaseClient.__init__ that look like contenders here, but I think we should treat those as a separate PR, so...

  • self.base_url - Potentially modify this to a property setter / getter style, but not 100% obvious?
  • self.auth - Potentially modify this to a property setter / getter style, but not 100% obvious?
  • self.timeout - Looks like it should definitely move to a property getter / setter style, as per params/headers/cookies.
  • self.max_redirects - I think this one is okay as a public attribute, since it's just a plain int.
  • self.trust_env - Setting this after __init__ isn't really valid (eg. the transport is already initialized) so we could move it to a read-only property?
  • self.netrc - Ought to be private.

Copy link
Member

@florimondmanca florimondmanca left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍👍👍

@tomchristie tomchristie merged commit a89d4ad into master Jul 17, 2020
@tomchristie tomchristie deleted the more-public-api-tightening branch July 17, 2020 10:19
@tomchristie tomchristie mentioned this pull request Jul 17, 2020
6 tasks
@tomchristie tomchristie mentioned this pull request Jul 24, 2020
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