title: How to fix TypeError in function to create shapely Polygon object
body: <p>I am attempting to create a function that creates a shapely Polygon object from either a list of point tuples (e.g. <code>point_list = [(100,2), (32, 22), (70, 10.2)])</code> or Point objects (e.g. <code>point_list = [point1, point2, point3]</code>, where <code>point1</code> is defined as <code>point1 = Point(100, 2)</code>, etc)</p>
  
  <p>I understand that Polygon([[p.x, p.y] for p in point_list])) will create a Polygon object, which is why I can't figure out why the below code is giving >"TypeError: object of type 'Point' has no len()"</p>
  
  <pre class="lang-py prettyprint-override"><code>point_list = [point1, point2, point3]
  
  def create_poly_geom(coords):
      assert type(coords) == type(list()), "Input should be a list"
      #assert len(coords) &gt;= 3, "Polygon object requires at least 3 points"
      for element in coords:
          assert type(element) == type(Point()) or type(element) == type(tuple()), 
      "All list values should be Shapely Point objects"
      if type(coords) == type(list()):
          return Polygon(coords)
      else:
          return Polygon([[p.x, p.y] for p in coords])
  
  print(create_poly_geom(point_list))
  </code></pre>
  
  <p>I get:  </p>
  
  <blockquote>
    <p>TypeError: object of type 'Point' has no len() when I should be getting a Polygon object</p>
  </blockquote>