twisted / treq

Python requests like API built on top of Twisted's HTTP client.
Other
587 stars 140 forks source link

treq should define an augmented response interface, not document private (???) concrete _Response class #245

Open glyph opened 5 years ago

glyph commented 5 years ago

The documentation currently documents _Response, which raises the question of what that underscore prefix is doing there exactly.

Instead, we should define a treq.itreq.IHelpfulResponse (better name pending) which documents all the extra attributes and is a sub-interface of Agent's IResponse, then document that rather than _Response itself. (Needless to say, _Response should then implement said interface.)

This would make it possible to write correct type annotations when https://github.com/Shoobx/mypy-zope has been updated to work with the latest mypy.

glyph commented 5 years ago

(cc @twm since this seems to be in his area of interest)