Message266985
One possible downside to the `classattribute` route is that we have a descriptor whose only purpose is to shield the item from becoming a member; the up-side is that it's simple to implement.
Another possibility is `skip`:
class skip:
"""
Protects item from becaming an Enum member during class creation.
"""
def __init__(self, value):
self.value = value
def __get__(self, instance, ownerclass=None):
return self.value
The advantage is that it is replaced by the metaclass with the stored value, so we have no extraneous descriptor after the Enum is created; the downside is that it requires change in the metaclass to do the right thing.
Thoughts? |
|
Date |
User |
Action |
Args |
2016-06-02 23:20:19 | ethan.furman | set | recipients:
+ ethan.furman, barry, eli.bendersky |
2016-06-02 23:20:19 | ethan.furman | set | messageid: <1464909619.0.0.721902519481.issue26266@psf.upfronthosting.co.za> |
2016-06-02 23:20:18 | ethan.furman | link | issue26266 messages |
2016-06-02 23:20:18 | ethan.furman | create | |
|