diff options
Diffstat (limited to 'Doc/library')
-rw-r--r-- | Doc/library/socket.rst | 14 | ||||
-rw-r--r-- | Doc/library/weakref.rst | 4 |
2 files changed, 11 insertions, 7 deletions
diff --git a/Doc/library/socket.rst b/Doc/library/socket.rst index e6ad578..292ea2d 100644 --- a/Doc/library/socket.rst +++ b/Doc/library/socket.rst @@ -565,17 +565,17 @@ correspond to Unix system calls applicable to sockets. is system-dependent (usually 5). -.. method:: socket.makefile([mode[, bufsize]]) +.. method:: socket.makefile(mode='r', buffering=None, *, encoding=None, newline=None) .. index:: single: I/O control; buffering Return a :dfn:`file object` associated with the socket. (File objects are - described in :ref:`bltin-file-objects`.) The file object - references a :cfunc:`dup`\ ped version of the socket file descriptor, so the - file object and socket object may be closed or garbage-collected independently. - The socket must be in blocking mode (it can not have a timeout). The optional - *mode* and *bufsize* arguments are interpreted the same way as by the built-in - :func:`file` function. + described in :ref:`bltin-file-objects`.) The file object references a + :cfunc:`dup`\ ped version of the socket file descriptor, so the file object + and socket object may be closed or garbage-collected independently. The + socket must be in blocking mode (it can not have a timeout). The optional + arguments are interpreted the same way as by the built-in :func:`open` + function. .. method:: socket.recv(bufsize[, flags]) diff --git a/Doc/library/weakref.rst b/Doc/library/weakref.rst index 9aaa58a..a667479 100644 --- a/Doc/library/weakref.rst +++ b/Doc/library/weakref.rst @@ -69,6 +69,10 @@ support weak references but can add support through subclassing:: obj = Dict(red=1, green=2, blue=3) # this object is weak referenceable +Other built-in types such as :class:`tuple` and :class:`int` do not support +weak references even when subclassed (those types implemented as a +:ctype:`PyVarObject`). + Extension types can easily be made to support weak references; see :ref:`weakref-support`. |