- Tests - gh-127906: Test the limited C API in test_cppext. Patch by Victor Stinner. - gh-127906: Backport test_cext from the main branch. Patch by Victor Stinner. - gh-127637: Add tests for the dis command-line interface. Patch by Bénédikt Tran. - Security - gh-105704: When using urllib.parse.urlsplit() and urllib.parse.urlparse() host parsing would not reject domain names containing square brackets ([ and ]). Square brackets are only valid for IPv6 and IPvFuture hosts according to RFC 3986 Section 3.2.2. (CVE-2025-0938, bsc#1236705) - gh-127655: Fixed the asyncio.selector_events._SelectorSocketTransport transport not pausing writes for the protocol when the buffer reaches the high water mark when using asyncio.WriteTransport.writelines() (CVE-2024-12254, bsc#1234290). - gh-126108: Fix a possible NULL pointer dereference in PySys_AddWarnOptionUnicode(). - gh-80222: Fix bug in the folding of quoted strings when flattening an email message using a modern email policy. Previously when a quoted string was folded so that it spanned more than one line, the surrounding quotes and internal escapes would be omitted. This could theoretically be used to spoof header lines using a carefully constructed quoted string if the resulting OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:Factory/python312?expand=0&rev=94
648 lines
15 KiB
Diff
648 lines
15 KiB
Diff
only in patch2:
|
|
unchanged:
|
|
---
|
|
Doc/library/turtle.rst | 81 -------------------------------------------------
|
|
1 file changed, 81 deletions(-)
|
|
|
|
Index: Python-3.12.2/Doc/library/turtle.rst
|
|
===================================================================
|
|
--- Python-3.12.2.orig/Doc/library/turtle.rst
|
|
+++ Python-3.12.2/Doc/library/turtle.rst
|
|
@@ -441,7 +441,6 @@ Turtle motion
|
|
turtle is headed.
|
|
|
|
.. doctest::
|
|
- :skipif: _tkinter is None
|
|
|
|
>>> turtle.position()
|
|
(0.00,0.00)
|
|
@@ -468,7 +467,6 @@ Turtle motion
|
|
>>> turtle.goto(0, 0)
|
|
|
|
.. doctest::
|
|
- :skipif: _tkinter is None
|
|
|
|
>>> turtle.position()
|
|
(0.00,0.00)
|
|
@@ -487,13 +485,11 @@ Turtle motion
|
|
orientation depends on the turtle mode, see :func:`mode`.
|
|
|
|
.. doctest::
|
|
- :skipif: _tkinter is None
|
|
:hide:
|
|
|
|
>>> turtle.setheading(22)
|
|
|
|
.. doctest::
|
|
- :skipif: _tkinter is None
|
|
|
|
>>> turtle.heading()
|
|
22.0
|
|
@@ -512,13 +508,11 @@ Turtle motion
|
|
orientation depends on the turtle mode, see :func:`mode`.
|
|
|
|
.. doctest::
|
|
- :skipif: _tkinter is None
|
|
:hide:
|
|
|
|
>>> turtle.setheading(22)
|
|
|
|
.. doctest::
|
|
- :skipif: _tkinter is None
|
|
|
|
>>> turtle.heading()
|
|
22.0
|
|
@@ -541,13 +535,11 @@ Turtle motion
|
|
not change the turtle's orientation.
|
|
|
|
.. doctest::
|
|
- :skipif: _tkinter is None
|
|
:hide:
|
|
|
|
>>> turtle.goto(0, 0)
|
|
|
|
.. doctest::
|
|
- :skipif: _tkinter is None
|
|
|
|
>>> tp = turtle.pos()
|
|
>>> tp
|
|
@@ -609,13 +601,11 @@ Turtle motion
|
|
unchanged.
|
|
|
|
.. doctest::
|
|
- :skipif: _tkinter is None
|
|
:hide:
|
|
|
|
>>> turtle.goto(0, 240)
|
|
|
|
.. doctest::
|
|
- :skipif: _tkinter is None
|
|
|
|
>>> turtle.position()
|
|
(0.00,240.00)
|
|
@@ -631,13 +621,11 @@ Turtle motion
|
|
Set the turtle's second coordinate to *y*, leave first coordinate unchanged.
|
|
|
|
.. doctest::
|
|
- :skipif: _tkinter is None
|
|
:hide:
|
|
|
|
>>> turtle.goto(0, 40)
|
|
|
|
.. doctest::
|
|
- :skipif: _tkinter is None
|
|
|
|
>>> turtle.position()
|
|
(0.00,40.00)
|
|
@@ -664,7 +652,6 @@ Turtle motion
|
|
=================== ====================
|
|
|
|
.. doctest::
|
|
- :skipif: _tkinter is None
|
|
|
|
>>> turtle.setheading(90)
|
|
>>> turtle.heading()
|
|
@@ -677,14 +664,12 @@ Turtle motion
|
|
its start-orientation (which depends on the mode, see :func:`mode`).
|
|
|
|
.. doctest::
|
|
- :skipif: _tkinter is None
|
|
:hide:
|
|
|
|
>>> turtle.setheading(90)
|
|
>>> turtle.goto(0, -10)
|
|
|
|
.. doctest::
|
|
- :skipif: _tkinter is None
|
|
|
|
>>> turtle.heading()
|
|
90.0
|
|
@@ -716,7 +701,6 @@ Turtle motion
|
|
calculated automatically. May be used to draw regular polygons.
|
|
|
|
.. doctest::
|
|
- :skipif: _tkinter is None
|
|
|
|
>>> turtle.home()
|
|
>>> turtle.position()
|
|
@@ -745,7 +729,6 @@ Turtle motion
|
|
|
|
|
|
.. doctest::
|
|
- :skipif: _tkinter is None
|
|
|
|
>>> turtle.home()
|
|
>>> turtle.dot()
|
|
@@ -763,7 +746,6 @@ Turtle motion
|
|
it by calling ``clearstamp(stamp_id)``.
|
|
|
|
.. doctest::
|
|
- :skipif: _tkinter is None
|
|
|
|
>>> turtle.color("blue")
|
|
>>> stamp_id = turtle.stamp()
|
|
@@ -778,7 +760,6 @@ Turtle motion
|
|
Delete stamp with given *stampid*.
|
|
|
|
.. doctest::
|
|
- :skipif: _tkinter is None
|
|
|
|
>>> turtle.position()
|
|
(150.00,-0.00)
|
|
@@ -816,7 +797,6 @@ Turtle motion
|
|
undo actions is determined by the size of the undobuffer.
|
|
|
|
.. doctest::
|
|
- :skipif: _tkinter is None
|
|
|
|
>>> for i in range(4):
|
|
... turtle.fd(50); turtle.lt(80)
|
|
@@ -849,7 +829,6 @@ Turtle motion
|
|
turtle turn instantly.
|
|
|
|
.. doctest::
|
|
- :skipif: _tkinter is None
|
|
|
|
>>> turtle.speed()
|
|
3
|
|
@@ -870,7 +849,6 @@ Tell Turtle's state
|
|
Return the turtle's current location (x,y) (as a :class:`Vec2D` vector).
|
|
|
|
.. doctest::
|
|
- :skipif: _tkinter is None
|
|
|
|
>>> turtle.pos()
|
|
(440.00,-0.00)
|
|
@@ -886,7 +864,6 @@ Tell Turtle's state
|
|
orientation which depends on the mode - "standard"/"world" or "logo".
|
|
|
|
.. doctest::
|
|
- :skipif: _tkinter is None
|
|
|
|
>>> turtle.goto(10, 10)
|
|
>>> turtle.towards(0,0)
|
|
@@ -898,7 +875,6 @@ Tell Turtle's state
|
|
Return the turtle's x coordinate.
|
|
|
|
.. doctest::
|
|
- :skipif: _tkinter is None
|
|
|
|
>>> turtle.home()
|
|
>>> turtle.left(50)
|
|
@@ -914,7 +890,6 @@ Tell Turtle's state
|
|
Return the turtle's y coordinate.
|
|
|
|
.. doctest::
|
|
- :skipif: _tkinter is None
|
|
|
|
>>> turtle.home()
|
|
>>> turtle.left(60)
|
|
@@ -931,7 +906,6 @@ Tell Turtle's state
|
|
:func:`mode`).
|
|
|
|
.. doctest::
|
|
- :skipif: _tkinter is None
|
|
|
|
>>> turtle.home()
|
|
>>> turtle.left(67)
|
|
@@ -948,7 +922,6 @@ Tell Turtle's state
|
|
other turtle, in turtle step units.
|
|
|
|
.. doctest::
|
|
- :skipif: _tkinter is None
|
|
|
|
>>> turtle.home()
|
|
>>> turtle.distance(30,40)
|
|
@@ -972,7 +945,6 @@ Settings for measurement
|
|
Default value is 360 degrees.
|
|
|
|
.. doctest::
|
|
- :skipif: _tkinter is None
|
|
|
|
>>> turtle.home()
|
|
>>> turtle.left(90)
|
|
@@ -995,7 +967,6 @@ Settings for measurement
|
|
``degrees(2*math.pi)``.
|
|
|
|
.. doctest::
|
|
- :skipif: _tkinter is None
|
|
|
|
>>> turtle.home()
|
|
>>> turtle.left(90)
|
|
@@ -1006,7 +977,6 @@ Settings for measurement
|
|
1.5707963267948966
|
|
|
|
.. doctest::
|
|
- :skipif: _tkinter is None
|
|
:hide:
|
|
|
|
>>> turtle.degrees(360)
|
|
@@ -1042,7 +1012,6 @@ Drawing state
|
|
thickness. If no argument is given, the current pensize is returned.
|
|
|
|
.. doctest::
|
|
- :skipif: _tkinter is None
|
|
|
|
>>> turtle.pensize()
|
|
1
|
|
@@ -1074,7 +1043,6 @@ Drawing state
|
|
attributes in one statement.
|
|
|
|
.. doctest::
|
|
- :skipif: _tkinter is None
|
|
:options: +NORMALIZE_WHITESPACE
|
|
|
|
>>> turtle.pen(fillcolor="black", pencolor="red", pensize=10)
|
|
@@ -1097,7 +1065,6 @@ Drawing state
|
|
Return ``True`` if pen is down, ``False`` if it's up.
|
|
|
|
.. doctest::
|
|
- :skipif: _tkinter is None
|
|
|
|
>>> turtle.penup()
|
|
>>> turtle.isdown()
|
|
@@ -1138,7 +1105,6 @@ Color control
|
|
newly set pencolor.
|
|
|
|
.. doctest::
|
|
- :skipif: _tkinter is None
|
|
|
|
>>> colormode()
|
|
1.0
|
|
@@ -1187,7 +1153,6 @@ Color control
|
|
with the newly set fillcolor.
|
|
|
|
.. doctest::
|
|
- :skipif: _tkinter is None
|
|
|
|
>>> turtle.fillcolor("violet")
|
|
>>> turtle.fillcolor()
|
|
@@ -1226,7 +1191,6 @@ Color control
|
|
with the newly set colors.
|
|
|
|
.. doctest::
|
|
- :skipif: _tkinter is None
|
|
|
|
>>> turtle.color("red", "green")
|
|
>>> turtle.color()
|
|
@@ -1243,7 +1207,6 @@ Filling
|
|
~~~~~~~
|
|
|
|
.. doctest::
|
|
- :skipif: _tkinter is None
|
|
:hide:
|
|
|
|
>>> turtle.home()
|
|
@@ -1253,7 +1216,6 @@ Filling
|
|
Return fillstate (``True`` if filling, ``False`` else).
|
|
|
|
.. doctest::
|
|
- :skipif: _tkinter is None
|
|
|
|
>>> turtle.begin_fill()
|
|
>>> if turtle.filling():
|
|
@@ -1278,7 +1240,6 @@ Filling
|
|
above may be either all yellow or have some white regions.
|
|
|
|
.. doctest::
|
|
- :skipif: _tkinter is None
|
|
|
|
>>> turtle.color("black", "red")
|
|
>>> turtle.begin_fill()
|
|
@@ -1295,7 +1256,6 @@ More drawing control
|
|
variables to the default values.
|
|
|
|
.. doctest::
|
|
- :skipif: _tkinter is None
|
|
|
|
>>> turtle.goto(0,-22)
|
|
>>> turtle.left(100)
|
|
@@ -1346,7 +1306,6 @@ Visibility
|
|
drawing observably.
|
|
|
|
.. doctest::
|
|
- :skipif: _tkinter is None
|
|
|
|
>>> turtle.hideturtle()
|
|
|
|
@@ -1357,7 +1316,6 @@ Visibility
|
|
Make the turtle visible.
|
|
|
|
.. doctest::
|
|
- :skipif: _tkinter is None
|
|
|
|
>>> turtle.showturtle()
|
|
|
|
@@ -1388,7 +1346,6 @@ Appearance
|
|
deal with shapes see Screen method :func:`register_shape`.
|
|
|
|
.. doctest::
|
|
- :skipif: _tkinter is None
|
|
|
|
>>> turtle.shape()
|
|
'classic'
|
|
@@ -1414,7 +1371,6 @@ Appearance
|
|
``resizemode("user")`` is called by :func:`shapesize` when used with arguments.
|
|
|
|
.. doctest::
|
|
- :skipif: _tkinter is None
|
|
|
|
>>> turtle.resizemode()
|
|
'noresize'
|
|
@@ -1438,7 +1394,6 @@ Appearance
|
|
of the shape's outline.
|
|
|
|
.. doctest::
|
|
- :skipif: _tkinter is None
|
|
|
|
>>> turtle.shapesize()
|
|
(1.0, 1.0, 1)
|
|
@@ -1463,7 +1418,6 @@ Appearance
|
|
heading of the turtle are sheared.
|
|
|
|
.. doctest::
|
|
- :skipif: _tkinter is None
|
|
|
|
>>> turtle.shape("circle")
|
|
>>> turtle.shapesize(5,2)
|
|
@@ -1480,7 +1434,6 @@ Appearance
|
|
change the turtle's heading (direction of movement).
|
|
|
|
.. doctest::
|
|
- :skipif: _tkinter is None
|
|
|
|
>>> turtle.reset()
|
|
>>> turtle.shape("circle")
|
|
@@ -1526,7 +1479,6 @@ Appearance
|
|
turtle (its direction of movement).
|
|
|
|
.. doctest::
|
|
- :skipif: _tkinter is None
|
|
|
|
>>> turtle.reset()
|
|
>>> turtle.shape("circle")
|
|
@@ -1555,7 +1507,6 @@ Appearance
|
|
given matrix.
|
|
|
|
.. doctest::
|
|
- :skipif: _tkinter is None
|
|
|
|
>>> turtle = Turtle()
|
|
>>> turtle.shape("square")
|
|
@@ -1571,7 +1522,6 @@ Appearance
|
|
can be used to define a new shape or components of a compound shape.
|
|
|
|
.. doctest::
|
|
- :skipif: _tkinter is None
|
|
|
|
>>> turtle.shape("square")
|
|
>>> turtle.shapetransform(4, -1, 0, 2)
|
|
@@ -1596,7 +1546,6 @@ Using events
|
|
procedural way:
|
|
|
|
.. doctest::
|
|
- :skipif: _tkinter is None
|
|
|
|
>>> def turn(x, y):
|
|
... left(180)
|
|
@@ -1617,7 +1566,6 @@ Using events
|
|
``None``, existing bindings are removed.
|
|
|
|
.. doctest::
|
|
- :skipif: _tkinter is None
|
|
|
|
>>> class MyTurtle(Turtle):
|
|
... def glow(self,x,y):
|
|
@@ -1645,7 +1593,6 @@ Using events
|
|
mouse-click event on that turtle.
|
|
|
|
.. doctest::
|
|
- :skipif: _tkinter is None
|
|
|
|
>>> turtle.ondrag(turtle.goto)
|
|
|
|
@@ -1673,7 +1620,6 @@ Special Turtle methods
|
|
Return the last recorded polygon.
|
|
|
|
.. doctest::
|
|
- :skipif: _tkinter is None
|
|
|
|
>>> turtle.home()
|
|
>>> turtle.begin_poly()
|
|
@@ -1693,7 +1639,6 @@ Special Turtle methods
|
|
turtle properties.
|
|
|
|
.. doctest::
|
|
- :skipif: _tkinter is None
|
|
|
|
>>> mick = Turtle()
|
|
>>> joe = mick.clone()
|
|
@@ -1706,7 +1651,6 @@ Special Turtle methods
|
|
return the "anonymous turtle":
|
|
|
|
.. doctest::
|
|
- :skipif: _tkinter is None
|
|
|
|
>>> pet = getturtle()
|
|
>>> pet.fd(50)
|
|
@@ -1720,7 +1664,6 @@ Special Turtle methods
|
|
TurtleScreen methods can then be called for that object.
|
|
|
|
.. doctest::
|
|
- :skipif: _tkinter is None
|
|
|
|
>>> ts = turtle.getscreen()
|
|
>>> ts
|
|
@@ -1738,7 +1681,6 @@ Special Turtle methods
|
|
``None``, the undobuffer is disabled.
|
|
|
|
.. doctest::
|
|
- :skipif: _tkinter is None
|
|
|
|
>>> turtle.setundobuffer(42)
|
|
|
|
@@ -1748,7 +1690,6 @@ Special Turtle methods
|
|
Return number of entries in the undobuffer.
|
|
|
|
.. doctest::
|
|
- :skipif: _tkinter is None
|
|
|
|
>>> while undobufferentries():
|
|
... undo()
|
|
@@ -1771,7 +1712,6 @@ below:
|
|
For example:
|
|
|
|
.. doctest::
|
|
- :skipif: _tkinter is None
|
|
|
|
>>> s = Shape("compound")
|
|
>>> poly1 = ((0,0),(10,-5),(0,10),(-10,-5))
|
|
@@ -1782,7 +1722,6 @@ below:
|
|
3. Now add the Shape to the Screen's shapelist and use it:
|
|
|
|
.. doctest::
|
|
- :skipif: _tkinter is None
|
|
|
|
>>> register_shape("myshape", s)
|
|
>>> shape("myshape")
|
|
@@ -1802,7 +1741,6 @@ Most of the examples in this section ref
|
|
``screen``.
|
|
|
|
.. doctest::
|
|
- :skipif: _tkinter is None
|
|
:hide:
|
|
|
|
>>> screen = Screen()
|
|
@@ -1819,7 +1757,6 @@ Window control
|
|
Set or return background color of the TurtleScreen.
|
|
|
|
.. doctest::
|
|
- :skipif: _tkinter is None
|
|
|
|
>>> screen.bgcolor("orange")
|
|
>>> screen.bgcolor()
|
|
@@ -1911,7 +1848,6 @@ Window control
|
|
distorted.
|
|
|
|
.. doctest::
|
|
- :skipif: _tkinter is None
|
|
|
|
>>> screen.reset()
|
|
>>> screen.setworldcoordinates(-50,-7.5,50,7.5)
|
|
@@ -1922,7 +1858,6 @@ Window control
|
|
... left(45); fd(2) # a regular octagon
|
|
|
|
.. doctest::
|
|
- :skipif: _tkinter is None
|
|
:hide:
|
|
|
|
>>> screen.reset()
|
|
@@ -1944,7 +1879,6 @@ Animation control
|
|
Optional argument:
|
|
|
|
.. doctest::
|
|
- :skipif: _tkinter is None
|
|
|
|
>>> screen.delay()
|
|
10
|
|
@@ -1966,7 +1900,6 @@ Animation control
|
|
:func:`delay`).
|
|
|
|
.. doctest::
|
|
- :skipif: _tkinter is None
|
|
|
|
>>> screen.tracer(8, 25)
|
|
>>> dist = 2
|
|
@@ -2003,7 +1936,6 @@ Using screen events
|
|
must have the focus. (See method :func:`listen`.)
|
|
|
|
.. doctest::
|
|
- :skipif: _tkinter is None
|
|
|
|
>>> def f():
|
|
... fd(50)
|
|
@@ -2024,7 +1956,6 @@ Using screen events
|
|
must have focus. (See method :func:`listen`.)
|
|
|
|
.. doctest::
|
|
- :skipif: _tkinter is None
|
|
|
|
>>> def f():
|
|
... fd(50)
|
|
@@ -2049,7 +1980,6 @@ Using screen events
|
|
named ``turtle``:
|
|
|
|
.. doctest::
|
|
- :skipif: _tkinter is None
|
|
|
|
>>> screen.onclick(turtle.goto) # Subsequently clicking into the TurtleScreen will
|
|
>>> # make the turtle move to the clicked point.
|
|
@@ -2069,7 +1999,6 @@ Using screen events
|
|
Install a timer that calls *fun* after *t* milliseconds.
|
|
|
|
.. doctest::
|
|
- :skipif: _tkinter is None
|
|
|
|
>>> running = True
|
|
>>> def f():
|
|
@@ -2151,7 +2080,6 @@ Settings and special methods
|
|
============ ========================= ===================
|
|
|
|
.. doctest::
|
|
- :skipif: _tkinter is None
|
|
|
|
>>> mode("logo") # resets turtle heading to north
|
|
>>> mode()
|
|
@@ -2166,7 +2094,6 @@ Settings and special methods
|
|
values of color triples have to be in the range 0..*cmode*.
|
|
|
|
.. doctest::
|
|
- :skipif: _tkinter is None
|
|
|
|
>>> screen.colormode(1)
|
|
>>> turtle.pencolor(240, 160, 80)
|
|
@@ -2187,7 +2114,6 @@ Settings and special methods
|
|
do with a Tkinter Canvas.
|
|
|
|
.. doctest::
|
|
- :skipif: _tkinter is None
|
|
|
|
>>> cv = screen.getcanvas()
|
|
>>> cv
|
|
@@ -2199,7 +2125,6 @@ Settings and special methods
|
|
Return a list of names of all currently available turtle shapes.
|
|
|
|
.. doctest::
|
|
- :skipif: _tkinter is None
|
|
|
|
>>> screen.getshapes()
|
|
['arrow', 'blank', 'circle', ..., 'turtle']
|
|
@@ -2223,7 +2148,6 @@ Settings and special methods
|
|
coordinates: Install the corresponding polygon shape.
|
|
|
|
.. doctest::
|
|
- :skipif: _tkinter is None
|
|
|
|
>>> screen.register_shape("triangle", ((5,-3), (0,5), (-5,-3)))
|
|
|
|
@@ -2239,7 +2163,6 @@ Settings and special methods
|
|
Return the list of turtles on the screen.
|
|
|
|
.. doctest::
|
|
- :skipif: _tkinter is None
|
|
|
|
>>> for turtle in screen.turtles():
|
|
... turtle.color("red")
|
|
@@ -2301,7 +2224,6 @@ Methods specific to Screen, not inherite
|
|
center window vertically
|
|
|
|
.. doctest::
|
|
- :skipif: _tkinter is None
|
|
|
|
>>> screen.setup (width=200, height=200, startx=0, starty=0)
|
|
>>> # sets window to 200x200 pixels, in upper left of screen
|
|
@@ -2317,7 +2239,6 @@ Methods specific to Screen, not inherite
|
|
Set title of turtle window to *titlestring*.
|
|
|
|
.. doctest::
|
|
- :skipif: _tkinter is None
|
|
|
|
>>> screen.title("Welcome to the turtle zoo!")
|
|
|
|
@@ -2388,7 +2309,6 @@ Public classes
|
|
Example:
|
|
|
|
.. doctest::
|
|
- :skipif: _tkinter is None
|
|
|
|
>>> poly = ((0,0),(10,-5),(0,10),(-10,-5))
|
|
>>> s = Shape("compound")
|
|
@@ -2774,7 +2694,6 @@ Changes since Python 3.0
|
|
|
|
|
|
.. doctest::
|
|
- :skipif: _tkinter is None
|
|
:hide:
|
|
|
|
>>> for turtle in turtles():
|