Skip to content

Commit 10c4583

Browse files
hugovkvstinner
andauthored
gh-104876: Remove deprecated turtle.RawTurtle.settiltangle (#104877)
Co-authored-by: Victor Stinner <[email protected]>
1 parent 705e387 commit 10c4583

File tree

6 files changed

+12
-60
lines changed

6 files changed

+12
-60
lines changed

Doc/library/turtle.rst

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,6 @@ Turtle state
166166
| :func:`resizemode`
167167
| :func:`shapesize` | :func:`turtlesize`
168168
| :func:`shearfactor`
169-
| :func:`settiltangle`
170169
| :func:`tiltangle`
171170
| :func:`tilt`
172171
| :func:`shapetransform`
@@ -1301,28 +1300,6 @@ Appearance
13011300
>>> turtle.fd(50)
13021301

13031302

1304-
.. function:: settiltangle(angle)
1305-
1306-
:param angle: a number
1307-
1308-
Rotate the turtleshape to point in the direction specified by *angle*,
1309-
regardless of its current tilt-angle. *Do not* change the turtle's heading
1310-
(direction of movement).
1311-
1312-
.. doctest::
1313-
:skipif: _tkinter is None or 'always; deprecated method'
1314-
1315-
>>> turtle.reset()
1316-
>>> turtle.shape("circle")
1317-
>>> turtle.shapesize(5,2)
1318-
>>> turtle.settiltangle(45)
1319-
>>> turtle.fd(50)
1320-
>>> turtle.settiltangle(-45)
1321-
>>> turtle.fd(50)
1322-
1323-
.. deprecated:: 3.1
1324-
1325-
13261303
.. function:: tiltangle(angle=None)
13271304

13281305
:param angle: a number (optional)
@@ -2529,8 +2506,7 @@ Changes since Python 3.0
25292506
:func:`get_shapepoly` have been added. Thus the full range of
25302507
regular linear transforms is now available for transforming turtle shapes.
25312508
:func:`tiltangle` has been enhanced in functionality: it now can
2532-
be used to get or set the tilt angle. :func:`settiltangle` has been
2533-
deprecated.
2509+
be used to get or set the tilt angle.
25342510

25352511
- The :class:`Screen` method :func:`onkeypress` has been added as a complement to
25362512
:func:`onkey`. As the latter binds actions to the key release event,

Doc/whatsnew/3.11.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1817,7 +1817,7 @@ Standard Library
18171817
They will be removed in Python 3.13.
18181818
(Contributed by Serhiy Storchaka and Miro Hrončok in :gh:`92728`.)
18191819

1820-
* :func:`turtle.settiltangle` has been deprecated since Python 3.1;
1820+
* :func:`!turtle.settiltangle` has been deprecated since Python 3.1;
18211821
it now emits a deprecation warning and will be removed in Python 3.13. Use
18221822
:func:`turtle.tiltangle` instead (it was earlier incorrectly marked
18231823
as deprecated, and its docstring is now corrected).

Doc/whatsnew/3.13.rst

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,11 @@ Removed
118118
* Remove support for using :class:`pathlib.Path` objects as context managers.
119119
This functionality was deprecated and made a no-op in Python 3.9.
120120

121+
* Remove the :meth:`!turtle.RawTurtle.settiltangle` method,
122+
deprecated in docs since Python 3.1
123+
and with a deprecation warning since Python 3.11.
124+
(Contributed by Hugo van Kemenade in :gh:`104876`.)
125+
121126
* Removed the following :mod:`unittest` functions, deprecated in Python 3.11:
122127

123128
* :func:`!unittest.findTestCases`
@@ -130,8 +135,6 @@ Removed
130135
* :meth:`unittest.TestLoader.loadTestsFromTestCase`
131136
* :meth:`unittest.TestLoader.getTestCaseNames`
132137

133-
(Contributed by Hugo van Kemenade in :gh:`104835`.)
134-
135138
* :pep:`594`: Remove the :mod:`!cgi`` and :mod:`!cgitb` modules,
136139
deprecated in Python 3.11.
137140

Lib/turtle.py

Lines changed: 1 addition & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@
127127
'isvisible', 'left', 'lt', 'onclick', 'ondrag', 'onrelease', 'pd',
128128
'pen', 'pencolor', 'pendown', 'pensize', 'penup', 'pos', 'position',
129129
'pu', 'radians', 'right', 'reset', 'resizemode', 'rt',
130-
'seth', 'setheading', 'setpos', 'setposition', 'settiltangle',
130+
'seth', 'setheading', 'setpos', 'setposition',
131131
'setundobuffer', 'setx', 'sety', 'shape', 'shapesize', 'shapetransform', 'shearfactor', 'showturtle',
132132
'speed', 'st', 'stamp', 'teleport', 'tilt', 'tiltangle', 'towards',
133133
'turtlesize', 'undo', 'undobufferentries', 'up', 'width',
@@ -2896,33 +2896,6 @@ def shearfactor(self, shear=None):
28962896
return self._shearfactor
28972897
self.pen(resizemode="user", shearfactor=shear)
28982898

2899-
def settiltangle(self, angle):
2900-
"""Rotate the turtleshape to point in the specified direction
2901-
2902-
Argument: angle -- number
2903-
2904-
Rotate the turtleshape to point in the direction specified by angle,
2905-
regardless of its current tilt-angle. DO NOT change the turtle's
2906-
heading (direction of movement).
2907-
2908-
Deprecated since Python 3.1
2909-
2910-
Examples (for a Turtle instance named turtle):
2911-
>>> turtle.shape("circle")
2912-
>>> turtle.shapesize(5,2)
2913-
>>> turtle.settiltangle(45)
2914-
>>> turtle.stamp()
2915-
>>> turtle.fd(50)
2916-
>>> turtle.settiltangle(-45)
2917-
>>> turtle.stamp()
2918-
>>> turtle.fd(50)
2919-
"""
2920-
warnings._deprecated("turtle.RawTurtle.settiltangle()",
2921-
"{name!r} is deprecated since Python 3.1 and scheduled "
2922-
"for removal in Python {remove}. Use tiltangle() instead.",
2923-
remove=(3, 13))
2924-
self.tiltangle(angle)
2925-
29262899
def tiltangle(self, angle=None):
29272900
"""Set or return the current tilt-angle.
29282901
@@ -2935,9 +2908,6 @@ def tiltangle(self, angle=None):
29352908
between the orientation of the turtleshape and the heading of the
29362909
turtle (its direction of movement).
29372910
2938-
(Incorrectly marked as deprecated since Python 3.1, it is really
2939-
settiltangle that is deprecated.)
2940-
29412911
Examples (for a Turtle instance named turtle):
29422912
>>> turtle.shape("circle")
29432913
>>> turtle.shapesize(5, 2)

Misc/NEWS.d/3.11.0a3.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -440,7 +440,7 @@ Added missing kw_only parameter to dataclasses.make_dataclass().
440440
.. nonce: aGyr1I
441441
.. section: Library
442442
443-
The :meth:`turtle.RawTurtle.settiltangle` is deprecated since Python 3.1, it
443+
The :meth:`!turtle.RawTurtle.settiltangle` is deprecated since Python 3.1, it
444444
now emits a deprecation warning and will be removed in Python 3.13.
445445

446446
Use :meth:`turtle.RawTurtle.tiltangle` instead.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Remove the :meth:`!turtle.RawTurtle.settiltangle` method, deprecated in docs
2+
since Python 3.1 and with a deprecation warning since Python 3.11. Patch by
3+
Hugo van Kemenade.

0 commit comments

Comments
 (0)