Removing/destroying a turtle from a screen
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 35/100
- issue の種類
- 機能追加
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- python
調査の方向性
まず TurtleScreen API と、issue で挙げられている既存の turtle メソッド、特に hideturtle() と clear() を読んでください。turtle が screen にどのように関連付けられているか、またそのライフサイクルを対象とするテストを確認してください。screen.remove(turtle) 操作によって指定された turtle を切り離し、回収できるようになれば完了です。
索引モデルが issue の本文から書いたものです。
説明
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.
- 主要言語
- Python
- スター
- 77.2k
- フォーク
- 36k
- 平均マージ
- 1日 9時間
- マージ済み PR(30日)
- 558
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
python/cpython のほかの issue
-
docs pending
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
stdlib type-feature
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
stdlib type-feature
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
-
build type-bug
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
-
stdlib topic-email type-feature
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
PolicyEngine/policyengine-us#9559 ·
-
priority: p3
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
googleapis/librarian#7636 ·
-
from:qa priority:P2 reliability tech-debt
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
spec-kitty/spec-kitty#4874 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100