Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

http.client.HTTPConnection and HTTPResponse are missing __repr__ #145651

Labels
stdlibStandard Library Python modules in the Lib/ directorytype-featureA feature request or enhancement
@JackDanger

Description

@JackDanger

http.client.HTTPConnection and HTTPResponse lackrepr implementations, producing the default unhelpful object repr:

>>>importhttp.client>>>http.client.HTTPConnection('example.com')<http.client.HTTPConnectionobjectat0x...>

These should show useful state at a glance:

>>>http.client.HTTPConnection('example.com')<HTTPConnectionexample.com:80>>>>http.client.HTTPSConnection('example.com')<HTTPSConnectionexample.com:443>

And for responses:

>>>r=conn.getresponse()>>>r<HTTPResponse [200OK]>

The module already has arepr on IncompleteRead, so there's precedent. This would help when debugging HTTP code in the REPL or debugger.

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    stdlibStandard Library Python modules in the Lib/ directorytype-featureA feature request or enhancement

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2026 Movatter.jp