python / python/cpython

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

Đang mở
#138,845 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

docs topic-tkinter
Ngôn ngữ chính
Python
Star
77.2k
Fork
35.9k
Chỉ số merge pull request
Chỉ số pull request đang chờ

Mô tả

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

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Hướng nghiên cứu

Bắt đầu với tài liệu của mô-đun turtle và xem lại các mục về reset(), left()/right(), degrees(), radians() và mode(). Làm rõ hành vi của reset() và các giá trị mặc định của đơn vị góc, giải thích những biến nào được đặt lại, đồng thời thêm các tham chiếu See also còn thiếu; các PRs được liên kết cho thấy công việc này có thể đã được tiến hành.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
python
Lĩnh vực
documentation
Loại issue
Tài liệu
Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
25/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.