(original) (raw)

changeset: 103655:4a027e55dae3 user: Ethan Furman ethan@stoneleaf.us date: Sun Sep 11 13:34:42 2016 -0700 files: Lib/socket.py description: issue28083: add IntFlag constants diff -r 223731925d06 -r 4a027e55dae3 Lib/socket.py --- a/Lib/socket.py Sun Sep 11 13:30:08 2016 -0700 +++ b/Lib/socket.py Sun Sep 11 13:34:42 2016 -0700 @@ -50,7 +50,7 @@ from _socket import * import os, sys, io, selectors -from enum import IntEnum +from enum import IntEnum, IntFlag try: import errno @@ -80,6 +80,16 @@ __name__, lambda C: C.isupper() and C.startswith('SOCK_')) +IntFlag._convert( + 'MsgFlag', + __name__, + lambda C: C.isupper() and C.startswith('MSG_')) + +IntFlag._convert( + 'AddressInfo', + __name__, + lambda C: C.isupper() and C.startswith('AI_')) + _LOCALHOST = '127.0.0.1' _LOCALHOST_V6 = '::1' /ethan@stoneleaf.us