treq icon indicating copy to clipboard operation
treq copied to clipboard

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

Open glyph opened this issue 6 years ago • 1 comments

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 avatar Jun 05 '19 18:06 glyph

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

glyph avatar Jun 05 '19 18:06 glyph