Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gh-103406: Modernize pos-only arguments usage intest_signature#103407

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
JelleZijlstra merged 4 commits intopython:mainfromsobolevn:issue-103406
Apr 14, 2023

Conversation

sobolevn
Copy link
Member

@sobolevnsobolevn commentedApr 10, 2023
edited by bedevere-bot
Loading

We can be sure that these.__signature__ manipulations are safe to removed, because:

  1. Tests do pass now
  2. Places where.replace calls are required by the test logic (for example, when testingSignature andParameter subclasses or invalid states) are not touched
  3. .__signature__ change is tested here:
    deftest_getfullargspec_signature_attr(self):
    deftest():
    pass
    spam_param=inspect.Parameter('spam',inspect.Parameter.POSITIONAL_ONLY)
    test.__signature__=inspect.Signature(parameters=(spam_param,))
    self.assertFullArgSpecEquals(test, ['spam'])

Now,/ is used where it must be used.

@sobolevn
Copy link
MemberAuthor

I am not sure about 3.10 backport 🤔

@sobolevn
Copy link
MemberAuthor

@JelleZijlstra would you have time to take a look, please?

@JelleZijlstraJelleZijlstra self-requested a reviewApril 11, 2023 06:47
@sobolevn
Copy link
MemberAuthor

Thank you for the review! 🎉

@miss-islington
Copy link
Contributor

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

@bedevere-bot
Copy link

GH-103536 is a backport of this pull request to the3.11 branch.

@bedevere-botbedevere-bot removed the needs backport to 3.11only security fixes labelApr 14, 2023
miss-islington pushed a commit to miss-islington/cpython that referenced this pull requestApr 14, 2023
…e` (pythonGH-103407)(cherry picked from commit7569781)Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
miss-islington added a commit that referenced this pull requestApr 14, 2023
…-103407)(cherry picked from commit7569781)Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
carljm added a commit to carljm/cpython that referenced this pull requestApr 14, 2023
* main:pythongh-103532: Remove TKINTER_PROTECT_LOADTK code (pythonGH-103535)pythongh-103180: Add CI timeouts to all GitHub Actions jobs (python#103437)  Remove double space in import error message (python#103458)  ipaddress: Remove non-existent ip_str param from docstring (python#103461)  Fix syntax typo in isolating extensions doc (python#103516)pythongh-103406: Modernize pos-only arguments usage in `test_signature` (python#103407)  Proofread howto/perf_profiling.rst (python#103530)  Fix unused functions warnings in instrumentation.c (pythonGH-103515)
carljm added a commit to carljm/cpython that referenced this pull requestApr 14, 2023
* superopt:  fix incompatible types  update generated cases  don't unnecessarily re-find args in error case  Apply suggestions from code reviewpythongh-103532: Remove TKINTER_PROTECT_LOADTK code (pythonGH-103535)pythongh-103180: Add CI timeouts to all GitHub Actions jobs (python#103437)  Remove double space in import error message (python#103458)  ipaddress: Remove non-existent ip_str param from docstring (python#103461)  Fix syntax typo in isolating extensions doc (python#103516)pythongh-103406: Modernize pos-only arguments usage in `test_signature` (python#103407)  Proofread howto/perf_profiling.rst (python#103530)  Fix unused functions warnings in instrumentation.c (pythonGH-103515)
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@JelleZijlstraJelleZijlstraJelleZijlstra approved these changes

Assignees
No one assigned
Labels
skip newstestsTests in the Lib/test dir
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

4 participants
@sobolevn@miss-islington@bedevere-bot@JelleZijlstra

[8]ページ先頭

©2009-2025 Movatter.jp