
Hello, in the current version (3.6.2rc1) of the documentation of the socket module, the description of socket.setsockopt says: |socket.||setsockopt|(/level/, /optname/, /value: int/) |socket.||setsockopt|(/level/, /optname/, /value: buffer/) |socket.||setsockopt|(/level/, /optname/, /None/, /optlen: int/) Set the value of the given socket option (see the Unix manual page /setsockopt(2)/). The needed symbolic constants are defined in the |socket| <https://docs.python.org/3.6/library/socket.html#module-socket> module (|SO_*| etc.). The value can be an integer, |None| or a bytes-like object <https://docs.python.org/3.6/glossary.html#term-bytes-like-object> representing a buffer. In the *later* case it is up to the caller to ensure that the bytestring contains the proper bits (see the optional built-in module |struct| <https://docs.python.org/3.6/library/struct.html#module-struct> for a way to encode C structures as bytestrings). When value is set to |None|, optlen argument is required. It’s equivalent to call setsockopt C function with optval=NULL and optlen=optlen. Changed in version 3.5: Writable bytes-like object <https://docs.python.org/3.6/glossary.html#term-bytes-like-object> is now accepted. Changed in version 3.6: setsockopt(level, optname, None, optlen: int) form added. In my opinion, the fourth sentence should start with 'In the *latter* case..' not with 'In the later case'. With kind regards Julian
participants (1)
-
Julian Filter