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

Class _TurtleImage

Lib/turtle.py:2565–2593  ·  view source on GitHub ↗

Helper class: Datatype to store Turtle attributes

Source from the content-addressed store, hash-verified

2563
2564
2565class _TurtleImage(object):
2566 """Helper class: Datatype to store Turtle attributes
2567 """
2568
2569 def __init__(self, screen, shapeIndex):
2570 self.screen = screen
2571 self._type = None
2572 self._setshape(shapeIndex)
2573
2574 def _setshape(self, shapeIndex):
2575 screen = self.screen
2576 self.shapeIndex = shapeIndex
2577 if self._type == "polygon" == screen._shapes[shapeIndex]._type:
2578 return
2579 if self._type == "image" == screen._shapes[shapeIndex]._type:
2580 return
2581 if self._type in ["image", "polygon"]:
2582 screen._delete(self._item)
2583 elif self._type == "compound":
2584 for item in self._item:
2585 screen._delete(item)
2586 self._type = screen._shapes[shapeIndex]._type
2587 if self._type == "polygon":
2588 self._item = screen._createpoly()
2589 elif self._type == "image":
2590 self._item = screen._createimage(screen._shapes["blank"]._data)
2591 elif self._type == "compound":
2592 self._item = [screen._createpoly() for item in
2593 screen._shapes[shapeIndex]._data]
2594
2595
2596class RawTurtle(TPen, TNavigator):

Callers 2

__init__Method · 0.85
cloneMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…