title: Python 3.x: Java valueOf() equivalent in Python 3.x
body: <p>Whilest learning Python 3 and converting some of my code from Java to Python 3.3 I came across a small problem I haven't been able to fix.<br>
  In Java I have this code (just dummy code to make it smaller):</p>
  
  <pre><code>public enum Mapping {
      C11{public int getMapping(){ return 1;}},
      C12{public int getMapping(){ return 2;}},
      public abstract int getMapping();
  }
  
  String s = "C11";
  System.out.println(Mapping.valueOf(s))
  </code></pre>
  
  <p>Works fine and prints the requisted '1'
  Trying to do this in Python doesn't work that easy (yet). I tried to imitate an Enum with:</p>
  
  <pre><code>class Mapping:
      C11=1
      C12=2
  
  s = 'C11'
  print(Mapping.Mapping.(magic should happen here).s)
  </code></pre>
  
  <p>Unfortunately I have no idea how to convert a string to an attribute to be called like that (or something similar).
  I need this because I have a HUGE list in the class Mapping and need to convert seemingly random words read from a text file to an integer mapping.<br></p>