[New-bugs-announce] [issue21406] Some socket constants are not enums

Antoine Pitrou report at bugs.python.org
Thu May 1 14:17:47 CEST 2014


New submission from Antoine Pitrou:

Many constants in the socket module, are not int enums. Examples are socket.CAN_BCM, socket.BTPROTO_RFCOMM, etc.

For example when creating a bluetooth socket, you may get the following repr():

>>> socket.socket(socket.AF_BLUETOOTH, socket.SOCK_STREAM, socket.BTPROTO_RFCOMM)
<socket.socket fd=3, family=AddressFamily.AF_BLUETOOTH, type=SocketType.SOCK_STREAM, proto=3, laddr=('00:00:00:00:00:00', 0), raddr=('00:00:00:00:00:00', 0)>

(notice the integer "proto")

----------
messages: 217691
nosy: barry, eli.bendersky, ethan.furman, neologix, pitrou
priority: low
severity: normal
status: open
title: Some socket constants are not enums
type: enhancement
versions: Python 3.5

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue21406>
_______________________________________


More information about the New-bugs-announce mailing list