MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / __init__

Method __init__

tools/python-3.11.9-amd64/Lib/turtle.py:878–892  ·  view source on GitHub ↗
(self, type_, data=None)

Source from the content-addressed store, hash-verified

876 an image or a list constructed using the addcomponent method.
877 """
878 def __init__(self, type_, data=None):
879 self._type = type_
880 if type_ == "polygon":
881 if isinstance(data, list):
882 data = tuple(data)
883 elif type_ == "image":
884 if isinstance(data, str):
885 if data.lower().endswith(".gif") and isfile(data):
886 data = TurtleScreen._image(data)
887 # else data assumed to be Photoimage
888 elif type_ == "compound":
889 data = []
890 else:
891 raise TurtleGraphicsError("There is no shape type %s" % type_)
892 self._data = data
893
894 def addcomponent(self, poly, fill, outline=None):
895 """Add component to a shape of type compound.

Callers

nothing calls this directly

Calls 6

isfileFunction · 0.90
tupleClass · 0.85
TurtleGraphicsErrorClass · 0.85
endswithMethod · 0.80
_imageMethod · 0.80
lowerMethod · 0.45

Tested by

no test coverage detected