New submission from Max:

This probably shouldn't happen:

    import enum

    class E(enum.Enum):
      A = enum.auto
      B = enum.auto

    x = E.B.value
    print(x) # <class 'enum.auto'>
    print(E(x))  # E.A

The first print() is kinda ok, I don't really care about which value was used 
by the implementation. But the second print() seems surprising.

By the same token, this probably shouldn't raise an exception (it does now):

    import enum

    @enum.unique
    class E(enum.Enum):
      A = enum.auto
      B = enum.auto
      C = object()

and `dir(E)` shouldn't skip `B` in its output (it does now).

----------
components: Library (Lib)
messages: 294804
nosy: max
priority: normal
severity: normal
status: open
title: Enum does not recognize enum.auto as unique values
type: behavior
versions: Python 3.6

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue30517>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to