python / cpython

The Python programming language
https://www.python.org
Other
62.42k stars 29.97k forks source link

socket: finish constant to Enum/Flag conversion #72270

Open ethanfurman opened 8 years ago

ethanfurman commented 8 years ago
BPO 28083
Nosy @tiran, @ned-deily, @ethanfurman, @serhiy-storchaka
Files
  • issue-socket.stoneleaf.01.patch
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields: ```python assignee = 'https://github.com/ethanfurman' closed_at = None created_at = labels = ['type-feature'] title = 'socket: finish constant to Enum/Flag conversion' updated_at = user = 'https://github.com/ethanfurman' ``` bugs.python.org fields: ```python activity = actor = 'ethan.furman' assignee = 'ethan.furman' closed = False closed_date = None closer = None components = [] creation = creator = 'ethan.furman' dependencies = [] files = ['44567'] hgrepos = [] issue_num = 28083 keywords = ['patch'] message_count = 8.0 messages = ['275851', '275852', '275854', '275867', '275868', '275870', '275902', '275931'] nosy_count = 5.0 nosy_names = ['christian.heimes', 'ned.deily', 'ethan.furman', 'python-dev', 'serhiy.storchaka'] pr_nums = [] priority = 'normal' resolution = None stage = 'commit review' status = 'open' superseder = None type = 'enhancement' url = 'https://bugs.python.org/issue28083' versions = ['Python 3.6'] ```

    ethanfurman commented 8 years ago

    Split from bpo-23591.

    Add IntFlag constants for consistency with IntEnum constants.

    1762cc99-3127-4a62-9baf-30c3d0f51ef7 commented 8 years ago

    New changeset 4a027e55dae3 by Ethan Furman in branch 'default': bpo-28083: add IntFlag constants https://hg.python.org/cpython/rev/4a027e55dae3

    tiran commented 8 years ago

    socketmodule.c has more namespaces. Are you planning to wrap them, too?

    NETLINK BTPROTO SOL HCI PF PACKET TIPC SCM ALG (*) CAN () RDS_ () IPPROTO IP IPV6 TCP EAI SHUT RCVALL_

    (*) constant namespace has sub-namespaces, e,g ALGSET and ALGOP

    ethanfurman commented 8 years ago

    I don't have enough socket experience to know which constants should go into what groups and what those groups should be called. So far my involvement has been to switch other's patches to use Enum._convert instead of "globals().update(Enum.__members__)". (This last patch was from Serhiy.)

    I am not opposed, though. ;)

    If Larry is okay with adding those during beta 1 I can work on it, but there's no way I could get it done before tomorrow.

    ethanfurman commented 8 years ago

    Still need to update docs.

    tiran commented 8 years ago

    You have to as Ned, not Larry. :)

    ned-deily commented 8 years ago

    One could argue that it is a bug that the other constants are missing. Ethan, if you can work with Christian to get them in by b2, that would be acceptable.

    ethanfurman commented 8 years ago

    Thanks, Ned!