Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 96d1eb1

Browse files
committed
Merged revisions 85732,85778,85785,85853,85930,86008,86089 via svnmerge from
svn+ssh://[email protected]/python/branches/py3k ........ r85732 | alexander.belopolsky | 2010-10-19 17:07:52 -0400 (Tue, 19 Oct 2010) | 3 lines Issue #7061: Fixed some of the issues in turtle module documentation reported by Terry J. Reedy. ........ r85778 | alexander.belopolsky | 2010-10-21 14:15:39 -0400 (Thu, 21 Oct 2010) | 1 line Issue #7061: Fixed section title ........ r85785 | alexander.belopolsky | 2010-10-21 18:29:36 -0400 (Thu, 21 Oct 2010) | 1 line Fixed a typo ........ r85853 | alexander.belopolsky | 2010-10-26 23:06:43 -0400 (Tue, 26 Oct 2010) | 4 lines Issue #7061: Dropped "for Tk" from turtle module title and moved its doc section under frameworks. Also fixed a couple of markup issues that affected TOC rendering. ........ r85930 | alexander.belopolsky | 2010-10-29 13:16:49 -0400 (Fri, 29 Oct 2010) | 1 line Issue 7061: Explained 'gon' ........ r86008 | alexander.belopolsky | 2010-10-30 20:51:11 -0400 (Sat, 30 Oct 2010) | 1 line Issues #7061, #10225: Fixed doctests in turtle manual ........ r86089 | alexander.belopolsky | 2010-11-01 11:45:34 -0400 (Mon, 01 Nov 2010) | 1 line Issue #7061: Simplified a section title. ........
1 parent 020e09a commit 96d1eb1

7 files changed

Lines changed: 56 additions & 54 deletions

File tree

Doc/library/ast.rst

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
.. _ast:
2-
3-
Abstract Syntax Trees
4-
=====================
1+
:mod:`ast` --- Abstract Syntax Trees
2+
====================================
53

64
.. module:: ast
75
:synopsis: Abstract Syntax Tree classes and manipulation.

Doc/library/frameworks.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,6 @@ The full list of modules described in this chapter is:
1313

1414
.. toctree::
1515

16+
turtle.rst
1617
cmd.rst
1718
shlex.rst

Doc/library/pdb.rst

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
.. _debugger:
2-
31
:mod:`pdb` --- The Python Debugger
42
==================================
53

@@ -158,7 +156,7 @@ access further features, you have to do this yourself:
158156
.. _debugger-commands:
159157

160158
Debugger Commands
161-
=================
159+
-----------------
162160

163161
The debugger recognizes the following commands. Most commands can be
164162
abbreviated to one or two letters; e.g. ``h(elp)`` means that either ``h`` or

Doc/library/sys.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -490,7 +490,7 @@ always available.
490490
Their intended use is to allow an interactive user to import a debugger module
491491
and engage in post-mortem debugging without having to re-execute the command
492492
that caused the error. (Typical use is ``import pdb; pdb.pm()`` to enter the
493-
post-mortem debugger; see chapter :ref:`debugger` for
493+
post-mortem debugger; see :mod:`pdb` module for
494494
more information.)
495495

496496
The meaning of the variables is the same as that of the return values from

Doc/library/tk.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ alternatives, see the :ref:`other-gui-packages` section.
3636
tkinter.ttk.rst
3737
tkinter.tix.rst
3838
tkinter.scrolledtext.rst
39-
turtle.rst
4039
idle.rst
4140
othergui.rst
4241

Doc/library/turtle.rst

Lines changed: 47 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
========================================
2-
:mod:`turtle` --- Turtle graphics for Tk
3-
========================================
1+
=================================
2+
:mod:`turtle` --- Turtle graphics
3+
=================================
44

55
.. module:: turtle
6-
:synopsis: Turtle graphics for Tk
6+
:synopsis: An educational framework for simple graphics applications
77
.. sectionauthor:: Gregor Lingl <[email protected]>
88

99
.. testsetup:: default
@@ -58,7 +58,7 @@ The object-oriented interface uses essentially two+two classes:
5858
or TurtleScreen as argument, so the RawTurtle objects know where to draw.
5959

6060
Derived from RawTurtle is the subclass :class:`Turtle` (alias: :class:`Pen`),
61-
which draws on "the" :class:`Screen` - instance which is automatically
61+
which draws on "the" :class:`Screen` instance which is automatically
6262
created, if not already present.
6363

6464
All methods of RawTurtle/Turtle also exist as functions, i.e. part of the
@@ -71,15 +71,15 @@ function derived from a Screen method is called. An (unnamed) turtle object is
7171
automatically created whenever any of the functions derived from a Turtle method
7272
is called.
7373

74-
To use multiple turtles an a screen one has to use the object-oriented interface.
74+
To use multiple turtles on a screen one has to use the object-oriented interface.
7575

7676
.. note::
7777
In the following documentation the argument list for functions is given.
7878
Methods, of course, have the additional first argument *self* which is
7979
omitted here.
8080

8181

82-
Overview over available Turtle and Screen methods
82+
Overview of available Turtle and Screen methods
8383
=================================================
8484

8585
Turtle methods
@@ -645,8 +645,8 @@ Tell Turtle's state
645645
>>> turtle.forward(100)
646646
>>> turtle.pos()
647647
(64.28,76.60)
648-
>>> print(turtle.xcor())
649-
64.2787609687
648+
>>> print(round(turtle.xcor(), 5))
649+
64.27876
650650

651651

652652
.. function:: ycor()
@@ -660,8 +660,8 @@ Tell Turtle's state
660660
>>> turtle.forward(100)
661661
>>> print(turtle.pos())
662662
(50.00,86.60)
663-
>>> print(turtle.ycor())
664-
86.6025403784
663+
>>> print(round(turtle.ycor(), 5))
664+
86.60254
665665

666666

667667
.. function:: heading()
@@ -714,7 +714,10 @@ Settings for measurement
714714
>>> turtle.left(90)
715715
>>> turtle.heading()
716716
90.0
717-
>>> turtle.degrees(400.0) # angle measurement in gon
717+
718+
Change angle measurement unit to grad (also known as gon,
719+
grade, or gradian and equals 1/100-th of the right angle.)
720+
>>> turtle.degrees(400.0)
718721
>>> turtle.heading()
719722
100.0
720723
>>> turtle.degrees(360)
@@ -810,20 +813,16 @@ Drawing state
810813
>>> sorted(turtle.pen().items())
811814
[('fillcolor', 'black'), ('outline', 1), ('pencolor', 'red'),
812815
('pendown', True), ('pensize', 10), ('resizemode', 'noresize'),
813-
('shown', True), ('speed', 9), ('stretchfactor', (1, 1)), ('tilt', 0)]
816+
('shearfactor', 0.0), ('shown', True), ('speed', 9),
817+
('stretchfactor', (1.0, 1.0)), ('tilt', 0.0)]
814818
>>> penstate=turtle.pen()
815819
>>> turtle.color("yellow", "")
816820
>>> turtle.penup()
817-
>>> sorted(turtle.pen().items())
818-
[('fillcolor', ''), ('outline', 1), ('pencolor', 'yellow'),
819-
('pendown', False), ('pensize', 10), ('resizemode', 'noresize'),
820-
('shown', True), ('speed', 9), ('stretchfactor', (1, 1)), ('tilt', 0)]
821+
>>> sorted(turtle.pen().items())[:3]
822+
[('fillcolor', ''), ('outline', 1), ('pencolor', 'yellow')]
821823
>>> turtle.pen(penstate, fillcolor="green")
822-
>>> sorted(turtle.pen().items())
823-
[('fillcolor', 'green'), ('outline', 1), ('pencolor', 'red'),
824-
('pendown', True), ('pensize', 10), ('resizemode', 'noresize'),
825-
('shown', True), ('speed', 9), ('stretchfactor', (1, 1)), ('tilt', 0)]
826-
824+
>>> sorted(turtle.pen().items())[:3]
825+
[('fillcolor', 'green'), ('outline', 1), ('pencolor', 'red')]
827826

828827
.. function:: isdown()
829828

@@ -884,10 +883,10 @@ Color control
884883
(0.2, 0.8, 0.5490196078431373)
885884
>>> colormode(255)
886885
>>> turtle.pencolor()
887-
(51, 204, 140)
886+
(51.0, 204.0, 140.0)
888887
>>> turtle.pencolor('#32c18f')
889888
>>> turtle.pencolor()
890-
(50, 193, 143)
889+
(50.0, 193.0, 143.0)
891890

892891

893892
.. function:: fillcolor(*args)
@@ -924,13 +923,13 @@ Color control
924923
'violet'
925924
>>> col = turtle.pencolor()
926925
>>> col
927-
(50, 193, 143)
926+
(50.0, 193.0, 143.0)
928927
>>> turtle.fillcolor(col)
929928
>>> turtle.fillcolor()
930-
(50, 193, 143)
929+
(50.0, 193.0, 143.0)
931930
>>> turtle.fillcolor('#ffffff')
932931
>>> turtle.fillcolor()
933-
(255, 255, 255)
932+
(255.0, 255.0, 255.0)
934933

935934

936935
.. function:: color(*args)
@@ -963,7 +962,7 @@ Color control
963962
('red', 'green')
964963
>>> color("#285078", "#a0c8f0")
965964
>>> color()
966-
((40, 80, 120), (160, 200, 240))
965+
((40.0, 80.0, 120.0), (160.0, 200.0, 240.0))
967966

968967

969968
See also: Screen method :func:`colormode`.
@@ -1157,7 +1156,7 @@ Appearance
11571156
.. doctest::
11581157

11591158
>>> turtle.shapesize()
1160-
(1, 1, 1)
1159+
(1.0, 1.0, 1)
11611160
>>> turtle.resizemode("user")
11621161
>>> turtle.shapesize(5, 5, 12)
11631162
>>> turtle.shapesize()
@@ -1184,7 +1183,7 @@ Appearance
11841183
>>> turtle.shapesize(5,2)
11851184
>>> turtle.shearfactor(0.5)
11861185
>>> turtle.shearfactor()
1187-
>>> 0.5
1186+
0.5
11881187

11891188

11901189
.. function:: tilt(angle)
@@ -1268,11 +1267,12 @@ Appearance
12681267

12691268
.. doctest::
12701269

1270+
>>> turtle = Turtle()
12711271
>>> turtle.shape("square")
12721272
>>> turtle.shapesize(4,2)
12731273
>>> turtle.shearfactor(-0.5)
12741274
>>> turtle.shapetransform()
1275-
>>> (4.0, -1.0, -0.0, 2.0)
1275+
(4.0, -1.0, -0.0, 2.0)
12761276

12771277

12781278
.. function:: get_shapepoly()
@@ -1456,8 +1456,8 @@ Special Turtle methods
14561456

14571457
.. _compoundshapes:
14581458

1459-
Excursus about the use of compound shapes
1460-
-----------------------------------------
1459+
Compound shapes
1460+
---------------
14611461

14621462
To use compound turtle shapes, which consist of several polygons of different
14631463
color, you must use the helper class :class:`Shape` explicitly as described
@@ -1511,6 +1511,7 @@ Window control
15111511
:param args: a color string or three numbers in the range 0..colormode or a
15121512
3-tuple of such numbers
15131513

1514+
15141515
Set or return background color of the TurtleScreen.
15151516

15161517
.. doctest::
@@ -1520,7 +1521,7 @@ Window control
15201521
'orange'
15211522
>>> screen.bgcolor("#800080")
15221523
>>> screen.bgcolor()
1523-
(128, 0, 128)
1524+
(128.0, 0.0, 128.0)
15241525

15251526

15261527
.. function:: bgpic(picname=None)
@@ -1548,7 +1549,7 @@ Window control
15481549

15491550
.. note::
15501551
This TurtleScreen method is available as a global function only under the
1551-
name ``clearscreen``. The global function ``clear`` is another one
1552+
name ``clearscreen``. The global function ``clear`` is a different one
15521553
derived from the Turtle method ``clear``.
15531554

15541555

@@ -1643,10 +1644,12 @@ Animation control
16431644
:param n: nonnegative integer
16441645
:param delay: nonnegative integer
16451646

1646-
Turn turtle animation on/off and set delay for update drawings. If *n* is
1647-
given, only each n-th regular screen update is really performed. (Can be
1648-
used to accelerate the drawing of complex graphics.) Second argument sets
1649-
delay value (see :func:`delay`).
1647+
Turn turtle animation on/off and set delay for update drawings. If
1648+
*n* is given, only each n-th regular screen update is really
1649+
performed. (Can be used to accelerate the drawing of complex
1650+
graphics.) When called without arguments, returns the currently
1651+
stored value of n. Second argument sets delay value (see
1652+
:func:`delay`).
16501653

16511654
.. doctest::
16521655

@@ -1790,8 +1793,8 @@ Input methods
17901793
:param title: string
17911794
:param prompt: string
17921795
:param default: number (optional)
1793-
:param prompt: number (optional)
1794-
:param prompt: number (optional)
1796+
:param minval: number (optional)
1797+
:param maxval: number (optional)
17951798

17961799
Pop up a dialog window for input of a number. title is the title of the
17971800
dialog window, prompt is a text mostly describing what numerical information
@@ -1991,8 +1994,8 @@ Methods specific to Screen, not inherited from TurtleScreen
19911994
>>> screen.title("Welcome to the turtle zoo!")
19921995

19931996

1994-
The public classes of the module :mod:`turtle`
1995-
==============================================
1997+
Public classes
1998+
==============
19961999

19972000

19982001
.. class:: RawTurtle(canvas)
@@ -2323,7 +2326,7 @@ The demoscripts are:
23232326
+----------------+------------------------------+-----------------------+
23242327
| round_dance | dancing turtles rotating | compound shapes, clone|
23252328
| | pairwise in opposite | shapesize, tilt, |
2326-
| | direction | get_polyshape, update |
2329+
| | direction | get_shapepoly, update |
23272330
+----------------+------------------------------+-----------------------+
23282331
| tree | a (graphical) breadth | :func:`clone` |
23292332
| | first tree (using generators)| |

Lib/turtle.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1575,7 +1575,10 @@ def degrees(self, fullcircle=360.0):
15751575
>>> turtle.left(90)
15761576
>>> turtle.heading()
15771577
90
1578-
>>> turtle.degrees(400.0) # angle measurement in gon
1578+
1579+
Change angle measurement unit to grad (also known as gon,
1580+
grade, or gradian and equals 1/100-th of the right angle.)
1581+
>>> turtle.degrees(400.0)
15791582
>>> turtle.heading()
15801583
100
15811584

0 commit comments

Comments
 (0)