Get Enum name from multiple values python : <p>I'm trying to get the name of a enum given one of its multiple values:</p>

<pre><code>class DType(Enum):
    float32 = ["f", 8]
    double64 = ["d", 9]
</code></pre>

<p>when I try to get one value giving the name it works:</p>

<pre><code>print DType["float32"].value[1]  # prints 8
print DType["float32"].value[0]  # prints f
</code></pre>

<p>but when I try to get the name out of a given value only errors will come:</p>

<pre><code>print DataType(8).name
print DataType("f").name
</code></pre>

<blockquote>
  <p>raise ValueError("%s is not a valid %s" % (value, cls.<strong>name</strong>))</p>
  
  <p>ValueError: 8 is not a valid DataType</p>
  
  <p>ValueError: f is not a valid DataType</p>
</blockquote>

<p>Is there a way to make this? or am I using the wrong data structure?</p>
