python / python/cpython

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

Aperta
#138,845 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

docs topic-tkinter
Lingua principale
Python
Stelle
77.2k
Fork
35.9k
Metriche di merge delle PR
Metriche PR in attesa

Descrizione

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

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Iniziare dalla documentazione del modulo turtle e rivedere le voci relative a reset(), left()/right(), degrees(), radians() e mode(). Chiarire il comportamento di reset() e i valori predefiniti delle unità angolari, spiegare quali variabili vengono reimpostate e aggiungere i riferimenti See also mancanti; i PRs collegati indicano che questo lavoro potrebbe essere già in corso.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
python
Ambito
documentation
Tipo di issue
Documentazione
Difficoltà
2/5
Tempo stimato
1-3 ore
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
25/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.