httpx icon indicating copy to clipboard operation
httpx copied to clipboard

Cleanup `trust_env` as property of Client.

Open T-256 opened this issue 1 year ago • 2 comments

Summary

No need to have trust_env as property since it only used on initialization. I added new test for trust_env behavior.

T-256 avatar Oct 08 '24 19:10 T-256

Is there any reason someone would want to check if the client has this option set?

zanieb avatar Oct 08 '24 22:10 zanieb

I didn't find any usecase/usage of it anywhere, btw anyone can use custom client to have it again:

class CustomClient(httpx.Client):
    def __init__(self, *, **kwargs) -> None:
        super().__init__(**kwargs)
        self._trust_env = kwargs.get("trust_env", True)

    @property
    def trust_env(self) -> bool:
        return self._trust_env

T-256 avatar Oct 09 '24 00:10 T-256