title: Python - TypeError: object of type '...' has no len()
body: <p>Here is a class:</p>
  
  <pre><code>class CoordinateRow(object):
  
  def __init__(self):
      self.coordinate_row = []
  
  def add(self, input):  
      self.coordinate_row.append(input)
  
  def weave(self, other):
      result = CoordinateRow()
      length = len(self.coordinate_row)
      for i in range(min(length, len(other))):
          result.add(self.coordinate_row[i])
          result.add(other.coordinate_row[i])
      return result
  </code></pre>
  
  <p>This is a part of my program:</p>
  
  <pre><code>def verwerk_regel(regel):
  cr = CoordinateRow()
  coordinaten = regel.split()
  for coordinaat in coordinaten:
      verwerkt_coordinaat = verwerk_coordinaat(coordinaat)
      cr.add(verwerkt_coordinaat)
  cr2 = CoordinateRow()
  cr12 = cr.weave(cr2)
  print cr12
  
  def verwerk_coordinaat(coordinaat):
  coordinaat = coordinaat.split(",")
  x = coordinaat[0]
  y = coordinaat[1]
  nieuw_coordinaat = Coordinate(x)
  adjusted_x = nieuw_coordinaat.pas_x_aan()
  return str(adjusted_x) + ',' + str(y)
  </code></pre>
  
  <p>But I'm geting an error at "cr12 = cr.weave(cr2)":</p>
  
  <p>for i in range(min(length, len(other))):</p>
  
  <p>TypeError: object of type 'CoordinateRow' has no len()</p>