(self)
return q
Create and return a clone of the turtle.

        No argument.

        Create and return a clone of the turtle with same position, heading
        and turtle properties.

        Example (for a Turtle instance named mick):
        mick = Turtle()
        joe = mick.clone()
Create and return a clone of the turtle.
Create and return a clone of the turtle .
def clone(self):
        """Create and return a clone of the turtle.

        No argument.

        Create and return a clone of the turtle with same position, heading
        and turtle properties.

        Example (for a Turtle instance named mick):
        mick = Turtle()
        joe = mick.clone()
        """
        screen = self.screen
        self._newLine(self._drawing)

        turtle = self.turtle
        self.screen = None
        self.turtle = None  # too make self deepcopy-able

        q = deepcopy(self)

        self.screen = screen
        self.turtle = turtle

        q.screen = screen
        q.turtle = _TurtleImage(screen, self.turtle.shapeIndex)

        screen._turtles.append(q)
        ttype = screen._shapes[self.turtle.shapeIndex]._type
        if ttype == "polygon":
            q.turtle._item = screen._createpoly()
        elif ttype == "image":
            q.turtle._item = screen._createimage(screen._shapes["blank"]._data)
        elif ttype == "compound":
            q.turtle._item = [screen._createpoly() for item in
                              screen._shapes[self.turtle.shapeIndex]._data]
        q.currentLineItem = screen._createline()
        q._update()
        return q
def clone ( self ) : screen = self . screen self . _newLine ( self . _drawing ) turtle = self . turtle self . screen = None self . turtle = None # too make self deepcopy-able q = deepcopy ( self ) self . screen = screen self . turtle = turtle q . screen = screen q . turtle = _TurtleImage ( screen , self . turtle . shapeIndex ) screen . _turtles . append ( q ) ttype = screen . _shapes [ self . turtle . shapeIndex ] . _type if ttype == "polygon" : q . turtle . _item = screen . _createpoly ( ) elif ttype == "image" : q . turtle . _item = screen . _createimage ( screen . _shapes [ "blank" ] . _data ) elif ttype == "compound" : q . turtle . _item = [ screen . _createpoly ( ) for item in screen . _shapes [ self . turtle . shapeIndex ] . _data ] q . currentLineItem = screen . _createline ( ) q . _update ( ) return q