[Python-Dev] [Python-checkins] peps: Pre-alpha draft for PEP 435 (enum). The name is not important at the moment, as

Nick Coghlan ncoghlan at gmail.com
Tue Feb 26 16:32:48 CET 2013


On Wed, Feb 27, 2013 at 1:09 AM, Terry Reedy <tjreedy at udel.edu> wrote:
> On 2/25/2013 2:48 PM, Antoine Pitrou wrote:
>>
>> On Mon, 25 Feb 2013 11:34:35 -0800
>> Ethan Furman <ethan at stoneleaf.us> wrote:
>>>
>>> Antoine, question for you:
>>>
>>> Do you think enums from different groupings should compare equal?
>>
>>
>> Equality should be mostly transitive so, yes, I think they should.
>
>
> Or if they do not, then they should neither compare equal to ints. One or
> the other, take your pick, or make both choices available.

I'm already working on too many different things to take a serious run
at a labelled values proposal, but it is avoiding precisely this kind
of problem that makes me favour a permissive solution that *doesn't*
define any new behaviour for the instance, aside from changing the
result of repr() and the contents of pickles. (You could potentially
combine it with a "sensitive values" proposal that ensured repr() and
other operations only displayed the label without showing the contents
at all - this is also potentially useful for labelling large strings
that may otherwise overwhelm debug output).

Cheers,
Nick.

-- 
Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia


More information about the Python-Dev mailing list