Author ethan.furman
Recipients barry, eli.bendersky, ethan.furman
Date 2016-06-02.23:20:18
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
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.

Date User Action Args
2016-06-02 23:20:19ethan.furmansetrecipients: + ethan.furman, barry, eli.bendersky
2016-06-02 23:20:19ethan.furmansetmessageid: <>
2016-06-02 23:20:18ethan.furmanlinkissue26266 messages
2016-06-02 23:20:18ethan.furmancreate