title: Assigning a set properties to each element of a list python
body: <p>I have a list containing unique items (names if you will) that changes every time I run my script. All of these items have some calculated properties that are modified during the script. For example 'S1' will have pos = 55 and ori = 'R'. I'd like an easy way to access these properties based on their name.</p>
  
  <p>What is the best way to 'assign' these properties? I have been looking around and dictionaries do not seem be the right way to go forward so I tried with classes and made the following non-functional code code:</p>
  
  <pre><code>class Primer: #contains all properties of a primer
      def __init__(self):
          """ Contains all properties of the primer """
          self.pos = 0 #outermost 5' position in sequence to bind
          self.ori = '' #F(orward) or R(everse)
  
  
  primer_list = ['S', 'M1', 'M2', 'M3', 'E']
  
  for i in primer_list:
          i = primer()
  
  print S.pos #this should give me the pos value of 'S'
  </code></pre>
  
  <p>Am I on the right track but missing something or is there a better way to do this?</p>
  
  <p><strong>EDIT</strong>
  I forgot to mentioned that I also need to get my values back somehow. Equally clueless how to do this</p>
  
  <pre><code>print primer_list[0].pos #should give me the pos value of S in my example
  </code></pre>