Skip to content

Conversation

@lovelydinosaur
Copy link
Contributor

Set __module__ = 'httpx' on all our public API.

Primarily useful for classes that haven't declared a __repr__ method, but might also improve the output of other code-introspection tooling?

Before:

>>> import httpx
>>> httpx.DigestAuth(username='', password='')
<httpx._auth.DigestAuth object at 0x106682850>

After:

>>> import httpx
>>> httpx.DigestAuth(username='', password='')
<httpx.DigestAuth object at 0x103529650>

@lovelydinosaur lovelydinosaur added the enhancement New feature or request label Aug 10, 2020
@felix-hilden
Copy link
Contributor

Glad to see this was useful! And using locals is a neat way of doing it. Should a similar issue be opened in httpcore as well, seeing that it could apply, e.g. the example in #1152?

(Also apologies if I'm intrusive, not really sure what conversation should be on Gitter or here...)

@lovelydinosaur
Copy link
Contributor Author

Yeah good call re. applying the same to httpcore. 👍

Copy link
Contributor

@felix-hilden felix-hilden left a comment

Choose a reason for hiding this comment

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

For what it's worth, it looks good to me! Having it on functions too is certainly good for consistency 👍

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

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants