Removing/destroying a turtle from a screen
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 35/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Bastante claro
- Estado de actividad
- Estancado
- Stack tecnológico
- python
- Área
- computer-graphics
Línea de trabajo
Comienza leyendo la API de TurtleScreen y los métodos existentes de turtle mencionados en el issue, especialmente hideturtle() y clear(). Comprueba cómo se asocian las tortugas con una pantalla y qué pruebas cubren su ciclo de vida; el trabajo estará terminado cuando exista una operación screen.remove(turtle) que desconecte la tortuga especificada y permita su recolección.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Feature or enhancement
Add new TurtleScreen method to remove a specific turtle.
screen.remove(turtle)
The turtle will be removed and no longer associated with the screen. Finally the object can be collected by the garbace collector.
Pitch
Turtle is a great way to learn Python and we use it with students to make simple games. In some games we create many turtles.
When I create a new turtle with:
my_turtle = turtle.Turtle()
I can:
- hide it with turtle.hideturtle()
- clear the drawing with turtle.clear()
However, I have no simple way to remove (destroy) the turtle.
It's a good programming practice to free the object that is no longer being used, so I would like to remove the unused turtles. Otherwise the turtles are piling up.
Previous discussion
This missing feature is discussed at multiple places on the web, e.g.:
https://stackoverflow.com/questions/43972351/how-to-fully-delete-a-turtle
There is no simple solution so far, rather complicated.
And since "Simple is better than complex. Complex is better than complicated." I propose this enhancement.
- Lenguaje dominante
- Python
- Estrellas
- 77.2k
- Forks
- 36k
- Merge medio
- 1 d 9 h
- PR fusionados (30 d)
- 558
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de python/cpython
-
docs pending
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
-
stdlib type-feature
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
-
stdlib type-feature
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
-
build type-bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
-
stdlib topic-email type-feature
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
Todos los issues de python/cpython
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
PolicyEngine/policyengine-us#9559 ·
-
priority: p3
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
googleapis/librarian#7636 ·
-
from:qa priority:P2 reliability tech-debt
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
spec-kitty/spec-kitty#4874 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100