diff -r e5d963cb6afc Lib/turtle.py --- a/Lib/turtle.py Sat May 24 00:32:29 2014 +0200 +++ b/Lib/turtle.py Fri Jun 20 15:58:41 2014 -0700 @@ -27,10 +27,11 @@ kids. It was part of the original Logo programming language developed by Wally Feurzig and Seymour Papert in 1966. -Imagine a robotic turtle starting at (0, 0) in the x-y plane. After an ``import turtle``, give it -the command turtle.forward(15), and it moves (on-screen!) 15 pixels in -the direction it is facing, drawing a line as it moves. Give it the -command turtle.right(25), and it rotates in-place 25 degrees clockwise. +Imagine a robotic turtle starting at (0, 0) in the x-y plane. After an +``import turtle``, give it the command turtle.forward(15), and it moves +(on-screen!) 15 pixels in the direction it is facing, drawing a line as it +moves. Give it the command turtle.right(25), and it rotates in-place 25 +degrees clockwise. By combining together these and similar commands, intricate shapes and pictures can easily be drawn. @@ -122,21 +123,21 @@ 'getshapes', 'listen', 'mainloop', 'mode', 'numinput', 'onkey', 'onkeypress', 'onkeyrelease', 'onscreenclick', 'ontimer', 'register_shape', 'resetscreen', 'screensize', 'setup', - 'setworldcoordinates', 'textinput', 'title', 'tracer', 'turtles', 'update', - 'window_height', 'window_width'] + 'setworldcoordinates', 'textinput', 'title', 'tracer', 'turtles', + 'update', 'window_height', 'window_width'] _tg_turtle_functions = ['back', 'backward', 'begin_fill', 'begin_poly', 'bk', 'circle', 'clear', 'clearstamp', 'clearstamps', 'clone', 'color', 'degrees', 'distance', 'dot', 'down', 'end_fill', 'end_poly', 'fd', - 'fillcolor', 'filling', 'forward', 'get_poly', 'getpen', 'getscreen', 'get_shapepoly', - 'getturtle', 'goto', 'heading', 'hideturtle', 'home', 'ht', 'isdown', - 'isvisible', 'left', 'lt', 'onclick', 'ondrag', 'onrelease', 'pd', - 'pen', 'pencolor', 'pendown', 'pensize', 'penup', 'pos', 'position', - 'pu', 'radians', 'right', 'reset', 'resizemode', 'rt', - 'seth', 'setheading', 'setpos', 'setposition', 'settiltangle', - 'setundobuffer', 'setx', 'sety', 'shape', 'shapesize', 'shapetransform', 'shearfactor', 'showturtle', - 'speed', 'st', 'stamp', 'tilt', 'tiltangle', 'towards', - 'turtlesize', 'undo', 'undobufferentries', 'up', 'width', - 'write', 'xcor', 'ycor'] + 'fillcolor', 'filling', 'forward', 'get_poly', 'getpen', 'getscreen', + 'get_shapepoly', 'getturtle', 'goto', 'heading', 'hideturtle', 'home', + 'ht', 'isdown', 'isvisible', 'left', 'lt', 'onclick', 'ondrag', + 'onrelease', 'pd', 'pen', 'pencolor', 'pendown', 'pensize', 'penup', + 'pos', 'position', 'pu', 'radians', 'right', 'reset', 'resizemode', + 'rt', 'seth', 'setheading', 'setpos', 'setposition', 'settiltangle', + 'setundobuffer', 'setx', 'sety', 'shape', 'shapesize', 'shapetransform', + 'shearfactor', 'showturtle', 'speed', 'st', 'stamp', 'tilt', + 'tiltangle', 'towards', 'turtlesize', 'undo', 'undobufferentries', + 'up', 'width', 'write', 'xcor', 'ycor'] _tg_utilities = ['write_docstringdict', 'done'] __all__ = (_tg_classes + _tg_screen_functions + _tg_turtle_functions + @@ -2936,17 +2937,17 @@ if t21 is not None: m21 = t21 if t22 is not None: m22 = t22 if t11 * t22 - t12 * t21 == 0: - raise TurtleGraphicsError("Bad shape transform matrix: must not be singular") + raise TurtleGraphicsError(("Bad shape transform matrix:" + "must not be singular")) self._shapetrafo = (m11, m12, m21, m22) alfa = math.atan2(-m21, m11) % (2 * math.pi) sa, ca = math.sin(alfa), math.cos(alfa) a11, a12, a21, a22 = (ca*m11 - sa*m21, ca*m12 - sa*m22, sa*m11 + ca*m21, sa*m12 + ca*m22) self._stretchfactor = a11, a22 - self._shearfactor = a12/a22 + self._shearfactor = a12/a22 self._tilt = alfa - self._update() - + self.pen(resizemode="user") def _polytrafo(self, poly): """Computes transformed polygon shapes from a shape