-
-
Notifications
You must be signed in to change notification settings - Fork 34.2k
Open
Labels
stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-featureA feature request or enhancementA feature request or enhancement
Description
http.client.HTTPConnection and HTTPResponse lack repr implementations, producing the default unhelpful object repr:
>>> import http.client
>>> http.client.HTTPConnection('example.com')
<http.client.HTTPConnection object at 0x...>These should show useful state at a glance:
>>> http.client.HTTPConnection('example.com')
<HTTPConnection example.com:80>
>>> http.client.HTTPSConnection('example.com')
<HTTPSConnection example.com:443>And for responses:
>>> r = conn.getresponse()
>>> r
<HTTPResponse [200 OK]>The module already has a repr on IncompleteRead, so there's precedent. This would help when debugging HTTP code in the REPL or debugger.
Linked PRs
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-featureA feature request or enhancementA feature request or enhancement