python / python/cpython

Doc: Clarify doc about turtle.reset() and angle measurement unit

未關閉
#138,845 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

docs topic-tkinter
主要語言
Python
星號
77.2k
分支
35.9k
PR 合併指標
PR 指標待擷取

描述

Documentation

The turtle module has a couple of functions that could cause misconceptions about the reset function and angle measurement unit.

turtle.reset():

Delete the turtle’s drawings from the screen, re-center the turtle and set variables to the default values.
  1. Re-center is not always true. It depends on the turtle mode. I think the right thing to say is something like "send the turtle to the (0, 0) position".
  2. What variables?

turtle.left()/rigth():

Turn turtle left/rigth by angle units. (Units are by default degrees, but can be set via the [degrees()](https://docs.python.org/3/library/turtle.html#turtle.degrees) and [radians()](https://docs.python.org/3/library/turtle.html#turtle.radians) functions.) Angle orientation depends on the turtle mode, see [mode()](https://docs.python.org/3/library/turtle.html#turtle.mode).

It is said that the unit defaults are degrees. But if we run turtle.radians() and after turtle.reset(), the unit doesn't change to degrees.

turtle.degrees(fullcircle=360.0)

Set angle measurement units, i.e. set number of “degrees” for a full circle. Default value is 360 degrees.

turtle.radians()

Set the angle measurement units to radians. Equivalent to degrees(2*math.pi).

These two last functions say nothing about the default unit. (and missing a "See also" in each)

Linked PRs
  • gh-138879
  • gh-138882

貢獻指南

開啟貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

研究方向

從 turtle 模組文件開始,檢視 reset()、left()/right()、degrees()、radians() 和 mode() 的條目。釐清 reset() 的行為和角度單位的預設值,說明哪些變數會被重設,並新增缺少的 See also 參照;連結的 PRs 表明這項工作可能已經在進行中。

由索引模型根據 Issue 內容生成。

評估

技術堆疊
python
領域
documentation
Issue 類型
文件
難度
2/5
預估耗時
1-3 小時
活躍度
停滯
描述清晰度
基本清楚
新手友好度
25/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。