Use calling syntax on Enum/IntEnum instead of make()

Bug #1162375 reported by Barry Warsaw
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
flufl.enum
Fix Released
High
Barry Warsaw

Bug Description

When PEP 435 is accepted, `enum.make()` may not be the best spelling. We can't put a classmethod on Enum since this will collide with the enum value namespace. One thought is to co-opt calling syntax for this purpose, e.g.

Animals = Enum('Animals', 'ant bee cat'.split())

or

People = IntEnum('People', 'anne bill cate dave elly'.split())

We'd probably want to deprecate single argument calling, which is pretty redundant anyway with getitem syntax.

Related branches

Barry Warsaw (barry)
Changed in flufl.enum:
assignee: nobody → Barry Warsaw (barry)
Barry Warsaw (barry)
Changed in flufl.enum:
status: In Progress → Fix Committed
Barry Warsaw (barry)
Changed in flufl.enum:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.