title: python how to get name of the enum
body: <p>I have an enum like this</p>
  
  <pre><code>class testEnum(Enum):
     Code_1 = "successful response"
     Code_2 = "failure response"
  </code></pre>
  
  <p>Then I have a method that takes the enum key name <code>Code_1</code> and enum key value <code>successful response</code> as inputs.</p>
  
  <p>If I send <code>testEnum.Code_1</code> then that resolves to <code>successful response</code> and not <code>Code_1</code>.</p>
  
  <p>I checked some documentation online that suggests to use <code>testEnum.Code_1.name</code> but that throws an error saing that 'name' doesn't exist for the enum item.</p>
  
  <p>Does anyone know how to get the name of the enum key ?</p>