title: Get Enum name from multiple values python
body: <p>I'm trying to get the name of a enum given one of its multiple values:</p>
  <pre><code>class DType(Enum):
      float32 = [&quot;f&quot;, 8]
      double64 = [&quot;d&quot;, 9]
  </code></pre>
  <p>when I try to get one value giving the name it works:</p>
  <pre><code>print DType[&quot;float32&quot;].value[1]  # prints 8
  print DType[&quot;float32&quot;].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(&quot;f&quot;).name
  </code></pre>
  <blockquote>
  <p>raise ValueError(&quot;%s is not a valid %s&quot; % (value, cls.<strong>name</strong>))</p>
  </blockquote>
  <blockquote>
  <p>ValueError: 8 is not a valid DataType</p>
  </blockquote>
  <blockquote>
  <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>