diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2010-08-09 20:39:54 (GMT) |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2010-08-09 20:39:54 (GMT) |
commit | 6e451df800af66eefe68ea15938bd65029af06c5 (patch) | |
tree | 3a94bf3c48a965f464f1f112d384076103a4676a /Doc | |
parent | 30e86a47676d2175901af29445aec5bd7967ef76 (diff) | |
download | cpython-6e451df800af66eefe68ea15938bd65029af06c5.zip cpython-6e451df800af66eefe68ea15938bd65029af06c5.tar.gz cpython-6e451df800af66eefe68ea15938bd65029af06c5.tar.bz2 |
Followup to r83869 and issue #8524: rename socket.forget() to socket.detach()
and make it return the file descriptor.
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/library/socket.rst | 17 | ||||
-rw-r--r-- | Doc/whatsnew/3.2.rst | 2 |
2 files changed, 10 insertions, 9 deletions
diff --git a/Doc/library/socket.rst b/Doc/library/socket.rst index 2b43266..f340920 100644 --- a/Doc/library/socket.rst +++ b/Doc/library/socket.rst @@ -538,6 +538,15 @@ correspond to Unix system calls applicable to sockets. connects. +.. method:: socket.detach() + + Put the socket object into closed state without actually closing the + underlying file descriptor. The file descriptor is returned, and can + be reused for other purposes. + + .. versionadded:: 3.2 + + .. method:: socket.fileno() Return the socket's file descriptor (a small integer). This is useful with @@ -548,14 +557,6 @@ correspond to Unix system calls applicable to sockets. this limitation. -.. method:: socket.forget() - - Put the socket object into closed state without actually closing the - underlying file descriptor. This allows the latter to be reused. - - .. versionadded:: 3.2 - - .. method:: socket.getpeername() Return the remote address to which the socket is connected. This is useful to diff --git a/Doc/whatsnew/3.2.rst b/Doc/whatsnew/3.2.rst index 487298f..bc31764 100644 --- a/Doc/whatsnew/3.2.rst +++ b/Doc/whatsnew/3.2.rst @@ -136,7 +136,7 @@ New, Improved, and Deprecated Modules (Contributed by Tarek Ziadé.) -* Socket objects now have a :meth:`~socket.socket.forget()` method which +* Socket objects now have a :meth:`~socket.socket.detach()` method which puts the socket into closed state without actually closing the underlying file descriptor. The latter can then be reused for other purposes. |