gh-107805: Fix signatures of module-level generated functions in turtle#107807
gh-107805: Fix signatures of module-level generated functions in turtle#107807gpshead merged 7 commits intopython:mainfrom
turtle#107807Conversation
|
I think that this can go into rc2, because it fixes a bug which makes |
gpshead
left a comment
There was a problem hiding this comment.
likely good, but i'll take a closer look tomorrow. one suggestion added.
|
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 |
Lib/test/test_turtle.py
Outdated
| 'pen': '(pen=None, **pendict)', | ||
| } | ||
|
|
||
| for name in turtle.__all__: |
There was a problem hiding this comment.
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.
serhiy-storchaka
left a comment
There was a problem hiding this comment.
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).
|
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've addressed @gpshead comments about the test case, but I don't think that I can actually test these functions:
If anyone wants to contribute some |
serhiy-storchaka
left a comment
There was a problem hiding this comment.
Well, testing module-level turtle function is a non-trivial task.
gpshead
left a comment
There was a problem hiding this comment.
I manually tested that turtle.Turtle() appears to work and that Turtle.teleport works.
…n `turtle` (pythonGH-107807) (cherry picked from commit 044b8b3) Co-authored-by: Nikita Sobolev <mail@sobolevn.me> Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
|
GH-108749 is a backport of this pull request to the 3.12 branch. |
Now we are using
inspect.signaturewhich 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
turtle.teleporthas incorrect-ish signature #107805