MCPcopy Index your code
hub / github.com/python/cpython / setundobuffer

Method setundobuffer

Lib/turtle.py:2668–2685  ·  view source on GitHub ↗

Set or disable undobuffer. Argument: size -- an integer or None If size is an integer an empty undobuffer of given size is installed. Size gives the maximum number of turtle-actions that can be undone by the undo() function. If size is None, no undob

(self, size)

Source from the content-addressed store, hash-verified

2666 self._update()
2667
2668 def setundobuffer(self, size):
2669 """Set or disable undobuffer.
2670
2671 Argument:
2672 size -- an integer or None
2673
2674 If size is an integer an empty undobuffer of given size is installed.
2675 Size gives the maximum number of turtle-actions that can be undone
2676 by the undo() function.
2677 If size is None, no undobuffer is present.
2678
2679 Example (for a Turtle instance named turtle):
2680 >>> turtle.setundobuffer(42)
2681 """
2682 if size is None or size <= 0:
2683 self.undobuffer = None
2684 else:
2685 self.undobuffer = Tbuffer(size)
2686
2687 def undobufferentries(self):
2688 """Return count of entries in the undobuffer.

Callers 2

_clearMethod · 0.95
maketreeFunction · 0.80

Calls 1

TbufferClass · 0.85

Tested by

no test coverage detected