title: Python pass enum as the constructor parameter
body: <p><BR>
  Does someone know, how can I use an Enum as class constructor parameter?
  I have created such class:</p>
  
  <pre><code>class Coin(Cash, Enum):
      onePenny = 1
      twoPens = 2
      fivePens = 5
  
      ones = 0
      twos = 0
      fives = 0
  
      def __init__(self, val):
          if val == onePenny:
              Cash.value = onePenny.value
              Coin.ones += 1
          elif val == twoPens:
              Cash.value = twoPens.value
              Coin.twos += 1
          else:
              print('Not existing coin.')
  </code></pre>
  
  <p>When I'm trying to create an object, I get the NameError:</p>
  
  <blockquote>
    <p>NameError: name 'onePenny' is not defined</p>
  </blockquote>
  
  <p>How to fix it?</p>