Skip to content

Turtle Circle Speed 0 #65276

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
GarrettGrimsley mannequin opened this issue Mar 27, 2014 · 7 comments · May be fixed by #104022
Open

Turtle Circle Speed 0 #65276

GarrettGrimsley mannequin opened this issue Mar 27, 2014 · 7 comments · May be fixed by #104022
Labels
stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error

Comments

@GarrettGrimsley
Copy link
Mannequin

GarrettGrimsley mannequin commented Mar 27, 2014

BPO 21077
Nosy @willingc
Files
  • aoeu.py: Source code that reproduces bug
  • update_example.py
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = None
    created_at = <Date 2014-03-27.16:16:30.735>
    labels = ['type-bug', 'library']
    title = 'Turtle Circle Speed 0'
    updated_at = <Date 2018-06-16.15:14:42.067>
    user = 'https://bugs.python.org/GarrettGrimsley'

    bugs.python.org fields:

    activity = <Date 2018-06-16.15:14:42.067>
    actor = 'willingc'
    assignee = 'none'
    closed = False
    closed_date = None
    closer = None
    components = ['Library (Lib)']
    creation = <Date 2014-03-27.16:16:30.735>
    creator = 'Garrett.Grimsley'
    dependencies = []
    files = ['34638', '36646']
    hgrepos = []
    issue_num = 21077
    keywords = []
    message_count = 3.0
    messages = ['214963', '227014', '319749']
    nosy_count = 4.0
    nosy_names = ['gregorlingl', 'ingrid', 'willingc', 'Garrett.Grimsley']
    pr_nums = []
    priority = 'normal'
    resolution = None
    stage = 'needs patch'
    status = 'open'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue21077'
    versions = ['Python 3.4', 'Python 3.5']

    Linked PRs

    @GarrettGrimsley
    Copy link
    Mannequin Author

    GarrettGrimsley mannequin commented Mar 27, 2014

    A circle is supposed to draw upon a click event, but if speed is set to 0 it appears that the circle fails to draw and all existing lines are erased.

    A screenshot of the behavior with radius = 20 can be seen here: http://i.imgur.com/y7z87AN.png This state can be replicated by completing an entire game worth of clicks.

    Someone replying to my StackOverflow question noted that if the radius of the circle is increased (radius = 200 for example) it becomes apparent that the circle is actually drawing, but the existing lines are still erased.

    A screenshot of the behavior with radius = 200 can be seen here: http://i.imgur.com/gYeOlnT.png This state can be replicated by clicking bottom middle, middle middle, then bottom right, in that order.

    You will note that only lines on the clickable Tic-Tac-Toe board are erased, and lines outside of it remain intact.

    Load my code and click the Tic-Tac-Toe board to reproduce the bug. Please use my exact code, as you WILL fail to reproduce the bug by simply importing turtle and drawing a circle. To change the circle radius in my code locate the radius variable assignment in the draw_circle() function. It is located on line 77 of the code.

    Source code in file aoeu.py above.
    Relevant StackExchange overflow link: http://stackoverflow.com/questions/22432679/turtle-circle-makes-lines-disappear/22445757

    @GarrettGrimsley GarrettGrimsley mannequin added the stdlib Python modules in the Lib dir label Mar 27, 2014
    @ezio-melotti ezio-melotti added the type-bug An unexpected behavior, bug, or error label May 26, 2014
    @ingrid
    Copy link
    Mannequin

    ingrid mannequin commented Sep 17, 2014

    This seems to be caused by a bug in TurtleScreen.update/turtle._drawturtle. When the speed is set to zero, the tracer method is used to regulate drawing circles, and when called with a positive integer, tracer calls update. Update iterates over the list of existing turtle objects and then updates them and calls _drawturtle on them, then redraws them, but doesn't draw lines or stamps so they'll get drawn over by shapes and images. I attached a snippet (update_example.py above) that shows the bug happening when you call update directly, if you switch the last line and use tracer instead the same thing happens. I think the way to fix it is to add stamps and lines to _drawturtle so I'm going to work on a patch that uses that approach.

    @willingc
    Copy link
    Contributor

    The next step on this issue would be to test if this behavior is still present in Python 3.6 and 3.7 and report the result of your test here.

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    @elzlee
    Copy link

    elzlee commented Apr 24, 2023

    Hello, my name is Elizabeth, and I’m part of a student software engineer group of 4 at Carnegie Mellon. We’ve been tasked with contributing to an open source project, and this issue seems like a great first start. Would you mind assigning this to me (my group)?

    @Mariatta
    Copy link
    Member

    Hi @elzlee, yes you and your group may start working on this issue. Please check out of DevGuide (https://devguide.python.org) which is our contributing guide to understand how to contribute to CPython. We don't (and unable to) "assign" issues to non-maintainers, so you can just go ahead and work on this.

    It looks like the next steps here are to re-run the sample code provided and see if the issue still exists in Python 3.12.. if it is no longer an issue, then let us know so the issue can be closed. and you may want to read Ingrid's comment above which may provide clues on where the bug exists and perhaps how to fix it.

    Let us know if you have further questions. Keep us updated on your investigation of this issue.

    @Fidget-Spinner
    Copy link
    Member

    Fidget-Spinner commented Apr 25, 2023

    Hi @elzlee, if you have any questions regarding CPython's contribution process, or you are evaluating what areas to contribute towards, you can email me at kenjin@python.org. I'll be more than happy to answer any queries your team may have.

    For some context, I work on the CPython typing module, the C parts of CPython (specifically the interpreter), and CPython performance. So if your team is interested in contributing to any of those areas, I would be happy to help.

    @terryjreedy
    Copy link
    Member

    I verified that Garrett's aoeu.py with line 12 setting speed to 0 commented out works (except for not detecting a winner). The default speed is 3. Uncommenting the line and clicking causes the erasure he mentions. Ingrid's short example with the last two lines commented out shows colored t1 square with stamped t2, line drawn by t2, and t2 in final position. Uncommenting either of the last two lines erases the stamp and line. What puzzles me is that the speed in not set to 0 but is left at 3. And what if different turtles have different speeds? Stopping here for now.

    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error
    Projects
    Status: No status
    Development

    Successfully merging a pull request may close this issue.

    6 participants