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

Method get_shapepoly

Lib/turtle.py:3082–3097  ·  view source on GitHub ↗

Return the current shape polygon as tuple of coordinate pairs. No argument. Examples (for a Turtle instance named turtle): >>> turtle.shape("square") >>> turtle.shapetransform(4, -1, 0, 2) >>> turtle.get_shapepoly() ((50, -20), (30, 20), (-50, 20), (

(self)

Source from the content-addressed store, hash-verified

3080 for (x, y) in poly]
3081
3082 def get_shapepoly(self):
3083 """Return the current shape polygon as tuple of coordinate pairs.
3084
3085 No argument.
3086
3087 Examples (for a Turtle instance named turtle):
3088 >>> turtle.shape("square")
3089 >>> turtle.shapetransform(4, -1, 0, 2)
3090 >>> turtle.get_shapepoly()
3091 ((50, -20), (30, 20), (-50, 20), (-30, -20))
3092
3093 """
3094 shape = self.screen._shapes[self.turtle.shapeIndex]
3095 if shape._type == "polygon":
3096 return self._getshapepoly(shape._data, shape._type == "compound")
3097 # else return None
3098
3099 def _getshapepoly(self, polygon, compound=False):
3100 """Calculate transformed shape polygon according to resizemode

Callers

nothing calls this directly

Calls 1

_getshapepolyMethod · 0.95

Tested by

no test coverage detected