title: Serialising an Enum member to JSON
body: <p>How do I serialise a Python <code>Enum</code> member to JSON, so that I can deserialise the resulting JSON back into a Python object?</p>
  <p>For example, this code:</p>
  <pre class="lang-py prettyprint-override"><code>from enum import Enum    
  import json
  
  class Status(Enum):
      success = 0
  
  json.dumps(Status.success)
  </code></pre>
  <p>results in the error:</p>
  <pre class="lang-none prettyprint-override"><code>TypeError: &lt;Status.success: 0&gt; is not JSON serializable
  </code></pre>
  <p>How can I avoid that?</p>