Removing/destroying a turtle from a screen
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- python
- Domain
- computer-graphics
Research direction
Start by reading the TurtleScreen API and the existing turtle methods named in the issue, especially hideturtle() and clear(). Check how turtles are associated with a screen and what tests cover their lifecycle; done should provide a screen.remove(turtle) operation that detaches the specified turtle and permits collection.
Written by the indexing model from the issue text.
Description
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.
- Dominant language
- Python
- Stars
- 77.2k
- Forks
- 36k
- Avg merge
- 1d 9h
- Merged PRs (30d)
- 558
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from python/cpython
-
docs pending
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
stdlib type-feature
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
stdlib type-feature
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
build type-bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
stdlib topic-email type-feature
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
-
🐛 Bug 🔔 Pending processing
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
jumpserver/jumpserver#17584 ·