(self, coords=None, dim=None)
Constructor.

        @param coords: the coordinates to be stored in the layout.
        @param dim: the number of dimensions. If C{None}, the number of
        dimensions is determined automatically from the length of the first
        item of the coordinate list. If there are no entries in the coordinate
        list, the default will be 2.  Generally, this should be given if the
        length of the coordinate list is zero, otherwise it should be left as
        is.
Constructor.
Constructor .
def __init__(self, coords=None, dim=None):
        """Constructor.

        @param coords: the coordinates to be stored in the layout.
        @param dim: the number of dimensions. If C{None}, the number of
        dimensions is determined automatically from the length of the first
        item of the coordinate list. If there are no entries in the coordinate
        list, the default will be 2.  Generally, this should be given if the
        length of the coordinate list is zero, otherwise it should be left as
        is.
        """
        if coords:
            self._coords = [list(coord) for coord in coords]
        else:
            self._coords = []

        if dim is None:
            if len(self._coords) == 0:
                self._dim = 2
            else:
                self._dim = len(self._coords[0])
        else:
            self._dim = int(dim)
            for row in self._coords:
                if len(row) != self._dim:
                    raise ValueError(
                        "all items in the coordinate list "
                        + "must have a length of %d" % self._dim
                    )
def __init__ ( self , coords = None , dim = None ) : if coords : self . _coords = [ list ( coord ) for coord in coords ] else : self . _coords = [ ] if dim is None : if len ( self . _coords ) == 0 : self . _dim = 2 else : self . _dim = len ( self . _coords [ 0 ] ) else : self . _dim = int ( dim ) for row in self . _coords : if len ( row ) != self . _dim : raise ValueError ( "all items in the coordinate list " + "must have a length of %d" % self . _dim )