diff --git a/Lib/turtle.py b/Lib/turtle.py index 2de406e0f517af..4f2ae036316030 100644 --- a/Lib/turtle.py +++ b/Lib/turtle.py @@ -2001,7 +2001,19 @@ def circle(self, radius, extent = None, steps = None): self._rotate(w) self._rotate(-w2) if speed == 0: - self._tracer(tr, dl) + previous_values = [] + for t in self.screen.turtles(): + if t == self: + continue + value_tuple = (t, t._shown, t._hidden_from_screen) + t._shown = False + t._hidden_from_screen = True + previous_values.append(value_tuple) + self._tracer(flag=tr, delay=dl) + for values in previous_values: + t, _shown, _hidden_from_screen = values + t._shown = _shown + t._hidden_from_screen = _hidden_from_screen self.speed(speed) if self.undobuffer: self.undobuffer.cumulate = False @@ -2726,7 +2738,7 @@ def _cc(self, args): if not ((0 <= r <= 255) and (0 <= g <= 255) and (0 <= b <= 255)): raise TurtleGraphicsError("bad color sequence: %s" % str(args)) return "#%02x%02x%02x" % (r, g, b) - + def teleport(self, x=None, y=None, *, fill_gap: bool = False) -> None: """Instantly move turtle to an absolute position. @@ -2738,14 +2750,14 @@ def teleport(self, x=None, y=None, *, fill_gap: bool = False) -> None: call: teleport(x, y) # two coordinates --or: teleport(x) # teleport to x position, keeping y as is --or: teleport(y=y) # teleport to y position, keeping x as is - --or: teleport(x, y, fill_gap=True) + --or: teleport(x, y, fill_gap=True) # teleport but fill the gap in between Move turtle to an absolute position. Unlike goto(x, y), a line will not be drawn. The turtle's orientation does not change. If currently filling, the polygon(s) teleported from will be filled after leaving, and filling will begin again after teleporting. This can be disabled - with fill_gap=True, which makes the imaginary line traveled during + with fill_gap=True, which makes the imaginary line traveled during teleporting act as a fill barrier like in goto(x, y). Example (for a Turtle instance named turtle): @@ -2773,7 +2785,7 @@ def teleport(self, x=None, y=None, *, fill_gap: bool = False) -> None: self._position = Vec2D(new_x, new_y) self.pen(pendown=pendown) if was_filling and not fill_gap: - self.begin_fill() + self.begin_fill() def clone(self): """Create and return a clone of the turtle. diff --git a/Misc/NEWS.d/next/Library/2023-04-30-21-31-37.gh-issue-65276.UGURF6.rst b/Misc/NEWS.d/next/Library/2023-04-30-21-31-37.gh-issue-65276.UGURF6.rst new file mode 100644 index 00000000000000..860b6b12b2f4d3 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2023-04-30-21-31-37.gh-issue-65276.UGURF6.rst @@ -0,0 +1,2 @@ +Fixed bug in the :mod:`turtle` module's :func:`turtle.circle` method, where calling with speed 0 made some objects disappear. +Patch by Liam Gersten.