title: Testing variable types in Python
body: <p>I'm creating an initialising function for the class 'Room', and found that the program wouldn't accept the tests I was doing on the input variables.</p>
  
  <p>Why is this?</p>
  
  <pre><code>def __init__(self, code, name, type, size, description, objects, exits):
      self.code = code
      self.name = name
      self.type = type
      self.size = size
      self.description = description
      self.objects = objects
      self.exits = exits
              #Check for input errors:
      if type(self.code) != type(str()):
          print 'Error found in module rooms.py!'
          print 'Error number: 110'
      elif type(self.name) != type(str()):
          print 'Error found in module rooms.py!'
          print 'Error number: 111'
      elif type(self.type) != type(str()):
          print 'Error found in module rooms.py!'
          print 'Error number: 112'
      elif type(self.size) != type(int()):
          print 'Error found in module rooms.py!'
          print 'Error number: 113'
      elif type(self.description) != type(str()):
          print 'Error found in module rooms.py!'
          print 'Error number: 114'
      elif type(self.objects) != type(list()):
          print 'Error found in module rooms.py!'
          print 'Error number: 115'
      elif type(self.exits) != type(tuple()):
          print 'Error found in module rooms.py!'
          print 'Error number: 116'
  </code></pre>
  
  <p>When I run this I get this error:</p>
  
  <pre><code>Traceback (most recent call last):
    File "/Users/Jasper/Development/Programming/MyProjects/Game Making Challenge/Europa   I/rooms.py", line 148, in &lt;module&gt;
      myRoom = Room(101, 'myRoom', 'Basic Room', 5, '&lt;insert description&gt;', myObjects, myExits)
    File "/Users/Jasper/Development/Programming/MyProjects/Game Making Challenge/Europa I/rooms.py", line 29, in __init__
      if type(self.code) != type(str()):
  TypeError: 'str' object is not callable
  </code></pre>
  
  <p>---- Thanks for help, but: -----</p>
  
  <p>does this apply for     isinstance(item, list) or     isinstance(item, tuple)?</p>