Mercurial > cpython-lru_cache-weakref
diff Lib/socket.py @ 38353:36cd4a4ab8f7 legacy-trunk
Support for buffer protocol for socket and struct.
* Added socket.recv_buf() and socket.recvfrom_buf() methods, that use the buffer
protocol (send and sendto already did).
* Added struct.pack_to(), that is the corresponding buffer compatible method to
unpack_from().
* Fixed minor typos in arraymodule.
| author | Martin Blais <blais@furius.ca> |
|---|---|
| date | Fri, 26 May 2006 12:03:27 +0000 |
| parents | 046e6e348381 |
| children | a114003aa3d3 |
line wrap: on
line diff
--- a/Lib/socket.py Fri May 26 12:01:49 2006 +0000 +++ b/Lib/socket.py Fri May 26 12:03:27 2006 +0000 @@ -140,7 +140,9 @@ __doc__ = _realsocket.__doc__ - __slots__ = ["_sock", "send", "recv", "sendto", "recvfrom", + __slots__ = ["_sock", + "recv", "recv_buf", "recvfrom_buf", + "send", "sendto", "recvfrom", "__weakref__"] def __init__(self, family=AF_INET, type=SOCK_STREAM, proto=0, _sock=None): @@ -149,8 +151,10 @@ self._sock = _sock self.send = self._sock.send self.recv = self._sock.recv + self.recv_buf = self._sock.recv_buf self.sendto = self._sock.sendto self.recvfrom = self._sock.recvfrom + self.recvfrom_buf = self._sock.recvfrom_buf def close(self): self._sock = _closedsocket()
