From: Ethan Furman Date: Wed, 15 Oct 2014 01:57:58 +0000 (-0700) Subject: Issue20386: SocketType is again socket.socket; the IntEnum SOCK constants are SocketKind X-Git-Tag: v3.5.0a1~658 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=41d31967c6bcc7e730a0db77cfe1dc334c6d853e;p=python Issue20386: SocketType is again socket.socket; the IntEnum SOCK constants are SocketKind --- 41d31967c6bcc7e730a0db77cfe1dc334c6d853e diff --cc Lib/socket.py index ca3d21cb65,a3bdca62ba..25631ef1d9 --- a/Lib/socket.py +++ b/Lib/socket.py @@@ -71,16 -73,11 +73,16 @@@ AddressFamily = IntEnum('AddressFamily' if name.isupper() and name.startswith('AF_')}) globals().update(AddressFamily.__members__) - SocketType = IntEnum('SocketType', + SocketKind = IntEnum('SocketKind', {name: value for name, value in globals().items() if name.isupper() and name.startswith('SOCK_')}) - globals().update(SocketType.__members__) + globals().update(SocketKind.__members__) + +_LOCALHOST = '127.0.0.1' +_LOCALHOST_V6 = '::1' + + def _intenum_converter(value, enum_klass): """Convert a numeric family value to an IntEnum member.