Skip to content

Commit 89bd454

Browse files
authored
[3.11] gh-104679 Fixed syntax highlighting in turtle docs (GH-104682). (#104695)
(cherry picked from commit 2c97878)
1 parent 795b20e commit 89bd454

File tree

1 file changed

+71
-71
lines changed

1 file changed

+71
-71
lines changed

Doc/library/turtle.rst

+71-71
Original file line numberDiff line numberDiff line change
@@ -358,18 +358,18 @@ Turtle motion
358358
.. doctest::
359359
:skipif: _tkinter is None
360360

361-
>>> tp = turtle.pos()
362-
>>> tp
363-
(0.00,0.00)
364-
>>> turtle.setpos(60,30)
365-
>>> turtle.pos()
366-
(60.00,30.00)
367-
>>> turtle.setpos((20,80))
368-
>>> turtle.pos()
369-
(20.00,80.00)
370-
>>> turtle.setpos(tp)
371-
>>> turtle.pos()
372-
(0.00,0.00)
361+
>>> tp = turtle.pos()
362+
>>> tp
363+
(0.00,0.00)
364+
>>> turtle.setpos(60,30)
365+
>>> turtle.pos()
366+
(60.00,30.00)
367+
>>> turtle.setpos((20,80))
368+
>>> turtle.pos()
369+
(20.00,80.00)
370+
>>> turtle.setpos(tp)
371+
>>> turtle.pos()
372+
(0.00,0.00)
373373

374374

375375
.. function:: setx(x)
@@ -919,23 +919,23 @@ Color control
919919
.. doctest::
920920
:skipif: _tkinter is None
921921

922-
>>> colormode()
923-
1.0
924-
>>> turtle.pencolor()
925-
'red'
926-
>>> turtle.pencolor("brown")
927-
>>> turtle.pencolor()
928-
'brown'
929-
>>> tup = (0.2, 0.8, 0.55)
930-
>>> turtle.pencolor(tup)
931-
>>> turtle.pencolor()
932-
(0.2, 0.8, 0.5490196078431373)
933-
>>> colormode(255)
934-
>>> turtle.pencolor()
935-
(51.0, 204.0, 140.0)
936-
>>> turtle.pencolor('#32c18f')
937-
>>> turtle.pencolor()
938-
(50.0, 193.0, 143.0)
922+
>>> colormode()
923+
1.0
924+
>>> turtle.pencolor()
925+
'red'
926+
>>> turtle.pencolor("brown")
927+
>>> turtle.pencolor()
928+
'brown'
929+
>>> tup = (0.2, 0.8, 0.55)
930+
>>> turtle.pencolor(tup)
931+
>>> turtle.pencolor()
932+
(0.2, 0.8, 0.5490196078431373)
933+
>>> colormode(255)
934+
>>> turtle.pencolor()
935+
(51.0, 204.0, 140.0)
936+
>>> turtle.pencolor('#32c18f')
937+
>>> turtle.pencolor()
938+
(50.0, 193.0, 143.0)
939939

940940

941941
.. function:: fillcolor(*args)
@@ -968,17 +968,17 @@ Color control
968968
.. doctest::
969969
:skipif: _tkinter is None
970970

971-
>>> turtle.fillcolor("violet")
972-
>>> turtle.fillcolor()
973-
'violet'
974-
>>> turtle.pencolor()
975-
(50.0, 193.0, 143.0)
976-
>>> turtle.fillcolor((50, 193, 143)) # Integers, not floats
977-
>>> turtle.fillcolor()
978-
(50.0, 193.0, 143.0)
979-
>>> turtle.fillcolor('#ffffff')
980-
>>> turtle.fillcolor()
981-
(255.0, 255.0, 255.0)
971+
>>> turtle.fillcolor("violet")
972+
>>> turtle.fillcolor()
973+
'violet'
974+
>>> turtle.pencolor()
975+
(50.0, 193.0, 143.0)
976+
>>> turtle.fillcolor((50, 193, 143)) # Integers, not floats
977+
>>> turtle.fillcolor()
978+
(50.0, 193.0, 143.0)
979+
>>> turtle.fillcolor('#ffffff')
980+
>>> turtle.fillcolor()
981+
(255.0, 255.0, 255.0)
982982

983983

984984
.. function:: color(*args)
@@ -1007,12 +1007,12 @@ Color control
10071007
.. doctest::
10081008
:skipif: _tkinter is None
10091009

1010-
>>> turtle.color("red", "green")
1011-
>>> turtle.color()
1012-
('red', 'green')
1013-
>>> color("#285078", "#a0c8f0")
1014-
>>> color()
1015-
((40.0, 80.0, 120.0), (160.0, 200.0, 240.0))
1010+
>>> turtle.color("red", "green")
1011+
>>> turtle.color()
1012+
('red', 'green')
1013+
>>> color("#285078", "#a0c8f0")
1014+
>>> color()
1015+
((40.0, 80.0, 120.0), (160.0, 200.0, 240.0))
10161016

10171017

10181018
See also: Screen method :func:`colormode`.
@@ -1034,11 +1034,11 @@ Filling
10341034
.. doctest::
10351035
:skipif: _tkinter is None
10361036

1037-
>>> turtle.begin_fill()
1038-
>>> if turtle.filling():
1039-
... turtle.pensize(5)
1040-
... else:
1041-
... turtle.pensize(3)
1037+
>>> turtle.begin_fill()
1038+
>>> if turtle.filling():
1039+
... turtle.pensize(5)
1040+
... else:
1041+
... turtle.pensize(3)
10421042

10431043

10441044

@@ -1244,11 +1244,11 @@ Appearance
12441244
.. doctest::
12451245
:skipif: _tkinter is None
12461246

1247-
>>> turtle.shape("circle")
1248-
>>> turtle.shapesize(5,2)
1249-
>>> turtle.shearfactor(0.5)
1250-
>>> turtle.shearfactor()
1251-
0.5
1247+
>>> turtle.shape("circle")
1248+
>>> turtle.shapesize(5,2)
1249+
>>> turtle.shearfactor(0.5)
1250+
>>> turtle.shearfactor()
1251+
0.5
12521252

12531253

12541254
.. function:: tilt(angle)
@@ -1617,11 +1617,11 @@ Window control
16171617
``"nopic"``, delete background image, if present. If *picname* is ``None``,
16181618
return the filename of the current backgroundimage. ::
16191619

1620-
>>> screen.bgpic()
1621-
'nopic'
1622-
>>> screen.bgpic("landscape.gif")
1623-
>>> screen.bgpic()
1624-
"landscape.gif"
1620+
>>> screen.bgpic()
1621+
'nopic'
1622+
>>> screen.bgpic("landscape.gif")
1623+
>>> screen.bgpic()
1624+
"landscape.gif"
16251625

16261626

16271627
.. function:: clear()
@@ -2028,16 +2028,16 @@ Settings and special methods
20282028

20292029
Return the height of the turtle window. ::
20302030

2031-
>>> screen.window_height()
2032-
480
2031+
>>> screen.window_height()
2032+
480
20332033

20342034

20352035
.. function:: window_width()
20362036

20372037
Return the width of the turtle window. ::
20382038

2039-
>>> screen.window_width()
2040-
640
2039+
>>> screen.window_width()
2040+
640
20412041

20422042

20432043
.. _screenspecific:
@@ -2218,12 +2218,12 @@ facilities:
22182218
in the range 0..colormode or a 3-tuple of such numbers.
22192219

22202220

2221-
>>> screen.bgcolor("orange")
2222-
>>> screen.bgcolor()
2223-
"orange"
2224-
>>> screen.bgcolor(0.5,0,0.5)
2225-
>>> screen.bgcolor()
2226-
"#800080"
2221+
>>> screen.bgcolor("orange")
2222+
>>> screen.bgcolor()
2223+
"orange"
2224+
>>> screen.bgcolor(0.5,0,0.5)
2225+
>>> screen.bgcolor()
2226+
"#800080"
22272227

22282228
>>> help(Turtle.penup)
22292229
Help on method penup in module turtle:

0 commit comments

Comments
 (0)