diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2016-10-02 09:34:40 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2016-10-02 09:34:40 (GMT) |
commit | 6a7d3480fc8fe4c60538547d2935083ccff0f631 (patch) | |
tree | 9a6a13be60de50579071c31c48079b980aee0bd1 /Doc/library/socket.rst | |
parent | a5749197aaecefef522c13544471a9cb571ab5b6 (diff) | |
download | cpython-6a7d3480fc8fe4c60538547d2935083ccff0f631.zip cpython-6a7d3480fc8fe4c60538547d2935083ccff0f631.tar.gz cpython-6a7d3480fc8fe4c60538547d2935083ccff0f631.tar.bz2 |
Issue #28332: Deprecated silent truncations in socket.htons and socket.ntohs.
Original patch by Oren Milman.
Diffstat (limited to 'Doc/library/socket.rst')
-rw-r--r-- | Doc/library/socket.rst | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/Doc/library/socket.rst b/Doc/library/socket.rst index 6909a64..d33bbc3 100644 --- a/Doc/library/socket.rst +++ b/Doc/library/socket.rst @@ -664,6 +664,12 @@ The :mod:`socket` module also offers various network-related services: where the host byte order is the same as network byte order, this is a no-op; otherwise, it performs a 2-byte swap operation. + .. deprecated:: 3.7 + In case *x* does not fit in 16-bit unsigned integer, but does fit in a + positive C int, it is silently truncated to 16-bit unsigned integer. + This silent truncation feature is deprecated, and will raise an + exception in future versions of Python. + .. function:: htonl(x) @@ -678,6 +684,12 @@ The :mod:`socket` module also offers various network-related services: where the host byte order is the same as network byte order, this is a no-op; otherwise, it performs a 2-byte swap operation. + .. deprecated:: 3.7 + In case *x* does not fit in 16-bit unsigned integer, but does fit in a + positive C int, it is silently truncated to 16-bit unsigned integer. + This silent truncation feature is deprecated, and will raise an + exception in future versions of Python. + .. function:: inet_aton(ip_string) |