'Delete all or first/last n of turtle\'s stamps.
Optional argument:
n -- an integer
If n is None, delete all of pen\'s stamps,
else if n > 0 delete first n stamps
else if n < 0 delete last n stamps.
Example (for a Turtle instance named turtle):
>>> for i in range(8):
...     turtle.stamp(); turtle.fd(30)
>>> turtle.clearstamps(2)
>>> turtle.clearstamps(-2)
>>> turtle.clearstamps()'

def clearstamps(self, n=None):

    if (n is None):
        toDelete = self.stampItems[:]
    elif (n >= 0):
        toDelete = self.stampItems[:n]
    else:
        toDelete = self.stampItems[n:]
    for item in toDelete:
        self._clearstamp(item)
    self._update()
