FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

gh-126349: Add context managers to turtle for `fill`, `poly` and `no_animation` by MarieRoald · Pull Request #126350 · python/cpython · GitHub

/ cpython Public

gh-126349: Add context managers to turtle for fill, poly and no_animation - #126350

Merged
erlend-aasland merged 30 commits into
python:mainfrom
MarieRoald:fix-issue-126349
Jan 18, 2025
Merged

gh-126349: Add context managers to turtle for fill, poly and no_animation#126350
erlend-aasland merged 30 commits into
python:mainfrom
MarieRoald:fix-issue-126349

Conversation

MarieRoald commented Nov 3, 2024
edited by hugovk
Loading

Copy link
Copy Markdown
Contributor

Adds fill(), poly() and no_animation() context managers to turtle.py.

Co-authored-by: Yngve Mardal Moe 3531982+yngvem@users.noreply.github.com


📚 Documentation preview 📚: https://cpython-previews--126350.org.readthedocs.build/en/126350/library/turtle.html

yngvem and others added 5 commits November 3, 2024 05:21
Co-authored-by: Marie Roald <roald.marie@gmail.com>
Co-authored-by: Yngve Mardal Moe <yngve.m.moe@gmail.com>
Co-authored-by: Yngve Mardal Moe <yngve.m.moe@gmail.com>
Co-authored-by: Marie Roald <roald.marie@gmail.com>
Co-authored-by: Marie Roald <roald.marie@gmail.com>

This comment was marked as outdated.

blurb-it Bot and others added 2 commits November 3, 2024 06:05
Co-authored-by: Yngve Mardal Moe <yngve.m.moe@gmail.com>

Copy link
Copy Markdown
Contributor

LGTM
Recommend adding to what's new 3.14.rst

This comment was marked as off-topic.

Comment thread Lib/turtle.py

Eclips4 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Could you please add a note about these additions to the Doc/whatsnew/3.14.rst?

Comment thread Doc/library/turtle.rst Outdated
Comment thread Doc/library/turtle.rst Outdated
Comment thread Doc/library/turtle.rst Outdated
Comment thread Doc/library/turtle.rst
Comment thread Lib/turtle.py
Comment thread Lib/test/test_turtle.py Outdated
Comment thread Lib/turtle.py Outdated
Comment thread Lib/turtle.py Outdated
Comment thread Lib/turtle.py Outdated
Comment thread Doc/library/turtle.rst Outdated
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Daniel Hollas <danekhollas@gmail.com>
Comment thread Doc/library/turtle.rst
Comment thread Doc/library/turtle.rst
Comment thread Doc/library/turtle.rst Outdated
Comment thread Doc/library/turtle.rst Outdated
Comment thread Doc/library/turtle.rst
Comment thread Doc/library/turtle.rst Outdated
Comment thread Doc/library/turtle.rst Outdated
Comment thread Lib/test/test_turtle.py Outdated
MarieRoald and others added 2 commits November 8, 2024 18:06
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Daniel Hollas <danekhollas@gmail.com>
Comment thread Doc/whatsnew/3.14.rst Outdated

yngvem commented Nov 8, 2024

Copy link
Copy Markdown
Contributor

We have tried to address the review comments now 🙂

picnixz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Some final minor nitpicks. Otherwise looks great!

Comment thread Doc/whatsnew/3.14.rst Outdated
Comment thread Lib/test/test_turtle.py Outdated
Comment thread Lib/test/test_turtle.py Outdated
Comment thread Lib/turtle.py Outdated
Comment thread Lib/turtle.py Outdated
Comment thread Lib/test/test_turtle.py Outdated
Comment thread Lib/test/test_turtle.py Outdated
Comment thread Doc/library/turtle.rst Outdated
MarieRoald and others added 3 commits November 9, 2024 05:39
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Marie Roald <roald.marie@gmail.com>
Co-authored-by: Marie Roald <roald.marie@gmail.com>

picnixz left a comment
edited
Loading

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Last one and I am good! (modulo Hugo's comment)

Comment thread Doc/library/turtle.rst
MarieRoald and others added 3 commits December 18, 2024 07:09
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>

hugovk commented Dec 29, 2024

Copy link
Copy Markdown
Member

(Conflict resolved.)

@erlend-aasland Any more comments or good to merge?

Comment thread Lib/test/test_turtle.py Outdated
erlend-aasland changed the title gh-126349 Add context managers to turtle for fill, poly and no_animation gh-126349: Add context managers to turtle for fill, poly and no_animation Dec 30, 2024
Co-authored-by: Yngve Mardal Moe <yngve.m.moe@gmail.com>
Comment thread Lib/test/test_turtle.py Outdated

graingert left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

the mock.patch context manager handling in the tests could be improved

MarieRoald and others added 4 commits January 18, 2025 04:56

yngvem commented Jan 18, 2025

Copy link
Copy Markdown
Contributor

We've addressed the review comments now 🙂

erlend-aasland dismissed graingert’s stale review January 18, 2025 10:17

Remark was addressed

erlend-aasland left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Thanks, everyone! :)

erlend-aasland merged commit d3adf02 into python:main Jan 18, 2025

vstinner commented Jan 19, 2025
edited
Loading

Copy link
Copy Markdown
Member

This change introduced a reference leak in test_turtle:

$ ./python -m test test_turtle -R 3:3
...
test_turtle leaked [13847, 13843, 13847] references, sum=41537
test_turtle leaked [3399, 3397, 3399] memory blocks, sum=10195
...

cc @encukou

Copy link
Copy Markdown
Member

I suspect that the regression comes from the new patch_screen() function in test_turtle.

yngvem commented Jan 20, 2025

Copy link
Copy Markdown
Contributor

I believe we found a fix. If we add the following teardown method to TestTurtle

    def tearDown(self):
        turtle.Turtle._screen = None
        return super().tearDown()

then @vstinner's command gives this output instead:

[...]
beginning 6 repetitions. Showing number of leaks (. for 0 or less, X for 10 or more)
123:456
XX. ...

== Tests result: SUCCESS ==
[...]

We're not sure how the workflow is for fixing regressions that we introduced. Should we make a new PR that starts with gh-126349:?

hugovk commented Jan 20, 2025

Copy link
Copy Markdown
Member

Should we make a new PR that starts with gh-126349:?

Yes please, because we've only just merged this PR, the fix can go under the same issue.

yngvem commented Jan 20, 2025

Copy link
Copy Markdown
Contributor

We'll submit a PR when we're off work today then :)

hugovk commented Jan 20, 2025

Copy link
Copy Markdown
Member

@encukou has created a fix at #129079.

srinivasreddy pushed a commit to srinivasreddy/cpython that referenced this pull request Jan 21, 2025
…ers to turtle (python#126350)

Co-authored-by: Marie Roald <roald.marie@gmail.com>
Co-authored-by: Yngve Mardal Moe <yngve.m.moe@gmail.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Daniel Hollas <danekhollas@gmail.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Erlend E. Aasland <erlend@python.org>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.


Back | FazBrowse Home | New Git URL