Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.