-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Closed
Description
Our HTTPRequest/HTTPResponse's .content attribute can currently be either
None, if we have not read the body yet (e.g. in thereponseheadershook)CONTENT_MISSING=0, if we deliberately deleted the bodyb"", if we read an (empty) body.b"some-content", if we actually read some content.
While the first three values intuitively evaluate to False, I feel the bytes/int/None heterogenity a bit confusing. I'd like to combine the first two cases, so that the type of this attribute can accurately be described as Optional[bytes]. This would fix #692 and make the code IMO easier to understand. We could also first deprecate CONTENT_MISSING gradually by setting it to None, and then remove it later on. @cortesi, would you be okay with this approach?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels