GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — gh-107805: Fix signatures of module-level generated functions in `turtle` by sobolevn · Pull Request #107807 · python/cpython

Conversation

@sobolevn

@sobolevn sobolevn commented Aug 9, 2023 •
edited by bedevere-bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

Now we are using inspect.signature which works correct for all possible parameter types.
There are no / params to test it, but it uses the same branch as regular pos-or-keyword params, so it should be fine.

Related #103974

  • Issue: turtle.teleport has incorrect-ish signature #107805

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@sobolevn
pythongh-107805: Fix signatures of module-level generated functions i…
40ee61d
…n `turtle`
@sobolevn
sobolevn requested review from gpshead and terryjreedy August 9, 2023 10:52
@bedevere-bot bedevere-bot added the awaiting review label Aug 9, 2023
@bedevere-bot bedevere-bot mentioned this pull request Aug 9, 2023
turtle.teleport has incorrect-ish signature #107805
Closed
@sobolevn

sobolevn commented Aug 9, 2023

Copy link
Copy Markdown
Member Author

I think that this can go into rc2, because it fixes a bug which makes turtle.teleport unusable.

Eclips4 and gpshead reacted with thumbs up emoji
All reactions
  • 👍 2 reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

sobolevn added 2 commits August 9, 2023 14:12
@sobolevn
Fix CI
03ea67d
@sobolevn
Fix CI
7f71ffd
@gpshead gpshead added type-bug An unexpected behavior, bug, or error needs backport to 3.12 only security fixes release-blocker labels Aug 10, 2023
@gpshead gpshead self-assigned this Aug 10, 2023
gpshead
gpshead requested changes Aug 10, 2023
View reviewed changes

@gpshead gpshead left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

likely good, but i'll take a closer look tomorrow. one suggestion added.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread Lib/turtle.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-bot bedevere-bot added awaiting changes and removed awaiting review labels Aug 10, 2023
@bedevere-bot

bedevere-bot commented Aug 10, 2023

Copy link
Copy Markdown

A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated.

Once you have made the requested changes, please leave a comment on this pull request containing the phrase I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

sobolevn added 2 commits August 10, 2023 09:42
@sobolevn
Use patma
43f131f
@sobolevn
Better error message
51f5bf0
serhiy-storchaka
serhiy-storchaka approved these changes Aug 11, 2023
View reviewed changes
@bedevere-bot bedevere-bot added awaiting merge and removed awaiting changes labels Aug 11, 2023
gpshead
gpshead reviewed Aug 18, 2023
View reviewed changes
Comment thread Lib/test/test_turtle.py Outdated
'pen': '(pen=None, **pendict)',
}

for name in turtle.__all__:

@gpshead gpshead Aug 10, 2023

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

The purpose of this test is only to verify known signatures, correct?

In that case, looping over known_signatures.items() rather than turtle.__all__ makes more sense. Otherwise a typo in a known_signatures name key would go silently unnoticed and we're otherwise creating subtests for all names in turtle even though most of them don't test anything.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
serhiy-storchaka
serhiy-storchaka requested changes Aug 18, 2023
View reviewed changes

@serhiy-storchaka serhiy-storchaka left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Well, I think that it would be nice to add also tests for the original issue:

  • Call teleport() without arguments.
  • Call teleport() with three positional arguments (it should fail).

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@bedevere-bot bedevere-bot removed the awaiting merge label Aug 18, 2023
@bedevere-bot

bedevere-bot commented Aug 18, 2023

Copy link
Copy Markdown

A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated.

Once you have made the requested changes, please leave a comment on this pull request containing the phrase I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-bot bedevere-bot added the awaiting changes label Aug 18, 2023
@sobolevn
Address review
438dcbc
@sobolevn

sobolevn commented Aug 21, 2023

Copy link
Copy Markdown
Member Author

I've addressed @gpshead comments about the test case, but I don't think that I can actually test these functions:

  1. Nothing similar is tested in test_turtle, it simply does not have any Turtle class tests at all
  2. I don't know anything about tkinter
  3. I don't really think that we should add test foundation for it in this specific PR
  4. inspect works with real python function signature, so it is at least something

If anyone wants to contribute some tkinter-based tests for Turtle class, I would be happy to include teleport test there 👍

gpshead reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@AlexWaygood
Merge branch 'main' into issue-107805
ac50e7f
serhiy-storchaka
serhiy-storchaka approved these changes Aug 27, 2023
View reviewed changes

@serhiy-storchaka serhiy-storchaka left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Well, testing module-level turtle function is a non-trivial task.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@bedevere-bot bedevere-bot added awaiting merge and removed awaiting changes labels Aug 27, 2023
gpshead
gpshead approved these changes Sep 1, 2023
View reviewed changes

@gpshead gpshead left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

I manually tested that turtle.Turtle() appears to work and that Turtle.teleport works.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@gpshead
gpshead merged commit 044b8b3 into python:main Sep 1, 2023
@miss-islington

miss-islington commented Sep 1, 2023

Copy link
Copy Markdown
Contributor

Thanks @sobolevn for the PR, and @gpshead for merging it 🌮🎉.. I'm working now to backport this PR to: 3.12.
🐍🍒⛏🤖 I'm not a witch! I'm not a witch!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-bot bedevere-bot removed the awaiting merge label Sep 1, 2023
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Sep 1, 2023
@sobolevn @AlexWaygood @miss-islington
pythongh-107805: Fix signatures of module-level generated functions i…
712dede
…n `turtle` (pythonGH-107807)

(cherry picked from commit 044b8b3)

Co-authored-by: Nikita Sobolev <[email protected]>
Co-authored-by: Alex Waygood <[email protected]>
@bedevere-bot

bedevere-bot commented Sep 1, 2023

Copy link
Copy Markdown

GH-108749 is a backport of this pull request to the 3.12 branch.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-bot bedevere-bot removed the needs backport to 3.12 only security fixes label Sep 1, 2023
Yhg1s pushed a commit that referenced this pull request Sep 1, 2023
@miss-islington @sobolevn @AlexWaygood
[3.12] gh-107805: Fix signatures of module-level generated functions …
5668309
…in `turtle` (GH-107807) (#108749)

gh-107805: Fix signatures of module-level generated functions in `turtle` (GH-107807)
(cherry picked from commit 044b8b3)

Co-authored-by: Nikita Sobolev <[email protected]>
Co-authored-by: Alex Waygood <[email protected]>
@adorilson adorilson mentioned this pull request Jun 28, 2025
Create tests for turtle module #135272
Open
1 of 21 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@gpshead gpshead gpshead approved these changes
@serhiy-storchaka serhiy-storchaka serhiy-storchaka approved these changes
@terryjreedy terryjreedy Awaiting requested review from terryjreedy

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@gpshead gpshead

Labels

release-blocker type-bug An unexpected behavior, bug, or error

Projects

Release and Deferred blockers 🚫
Status: Done

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

6 participants

@sobolevn @bedevere-bot @miss-islington @gpshead @serhiy-storchaka @AlexWaygood
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.