Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions Doc/library/http.client.rst
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,12 @@ The module provides the following classes:
number. If no port number is passed, the port is extracted from the host
string if it has the form ``host:port``, else the default HTTP port (80) is
used. If the optional *timeout* parameter is given, blocking
operations (like connection attempts) will timeout after that many seconds
(if it is not given, the global default timeout setting is used).
The optional *source_address* parameter may be a tuple of a (host, port)
to use as the source address the HTTP connection is made from.
The optional *blocksize* parameter sets the buffer size in bytes for
sending a file-like message body.
operations (like connection attempts) will timeout after that many seconds.
If it is ``None`` then blocking operations will not time out. If it is not given,
the global default timeout setting is used. The optional *source_address*
parameter may be a tuple of a (host, port) to use as the source address the
HTTP connection is made from. The optional *blocksize* parameter sets the buffer
size in bytes for sending a file-like message body.
Comment on lines +44 to +49
Copy link
Contributor

@slateny slateny Dec 11, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm personally no expert on the module so I can't quite give a proper review, but here's a few more comments:

Saying that the default timeout is used may give rise to the question of what it is, so if the following is accurate what do you think about including something like '... is used, which can be set by socket.settimeout()', since the actual variable being used (socket._GLOBAL_DEFAULT_TIMEOUT) isn't exposed?

On the side of formatting, to ease reviewing the changes, I would keep the original paragraph structure as close as possible, such as

Suggested change
operations (like connection attempts) will timeout after that many seconds.
If it is ``None`` then blocking operations will not time out. If it is not given,
the global default timeout setting is used. The optional *source_address*
parameter may be a tuple of a (host, port) to use as the source address the
HTTP connection is made from. The optional *blocksize* parameter sets the buffer
size in bytes for sending a file-like message body.
operations (like connection attempts) will timeout after that many seconds.
If it is ``None`` then blocking operations will not time out. If it is not given,
the global default timeout setting is used.
The optional *source_address* parameter may be a tuple of a (host, port)
to use as the source address the HTTP connection is made from.
The optional *blocksize* parameter sets the buffer size in bytes for
sending a file-like message body.

If I've done it right, only the addition should be shown after committing the change, which highlights the changes better. I wouldn't worry too much about how the raw paragraph looks as (imo) it's better to save review time than have a perfectly formatted rst file.

Another note is that there's this other PR introducing a similar note, which may somewhat invalidate these changes if it gets merged first. I do prefer this version a bit more as it integrates well into the paragraph, but I'll cross-reference this PR just as a heads up.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps you meant the setdefaulttimeout module function, rather than settimeout (a method)?


For example, the following calls all create instances that connect to the server
at the same host and port::
Expand Down