Skip to content

Conversation

@niconoe
Copy link

@niconoe niconoe commented Jun 21, 2018

@the-knights-who-say-ni
Copy link

Hello, and thanks for your contribution!

I'm a bot set up to make sure that the project can legally accept your contribution by verifying you have signed the PSF contributor agreement (CLA).

Unfortunately our records indicate you have not signed the CLA. For legal reasons we need you to sign this before we can look at your contribution. Please follow the steps outlined in the CPython devguide to rectify this issue.

When your account is ready, please add a comment in this pull request
and a Python core developer will remove the CLA not signed label
to make the bot check again.

Thanks again for your contribution, we look forward to reviewing it!

@vstinner
Copy link
Member

Does your PR change the output? If yes, it should be documented with a new NEWS entry (use the "blurb" tool to add it: https://devguide.python.org/committing/#what-s-new-and-news-entries ).

@vstinner
Copy link
Member

@1st1: Would you mind to have a look?

1st1
1st1 previously requested changes Jun 21, 2018
annotations=args.annotations,
formatvalue=self.formatvalue
)
sig.replace(parameters=tuple(sig.parameters.values())[1:])
Copy link
Member

Choose a reason for hiding this comment

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

sig.replace() returns a new Signature object, so you should have written sig = sig.replace(...). But inspect.signature should take care of the bound argument automatically, so you don't need this dance. if and elif clauses should be replaced with

if callable(object):
    argspec = str(signature(object))
else:
    argspec = '(...)'

Copy link
Member

Choose a reason for hiding this comment

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

How common a failure of signature()? Shouldn't we catch some common exceptions?

Copy link
Member

Choose a reason for hiding this comment

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

inspect.getfullargspec uses inspect.signature behind the scenes. So if you want to add some error handling, it should be in a separate PR.

@bedevere-bot
Copy link

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.

@niconoe
Copy link
Author

niconoe commented Jun 22, 2018

I have made the requested changes; please review again.

@vstinner: AFAIK, the output doesn't change (HTML output is compared in various test methods in test_docxmlrpc.py). What I didn't do is to ensure that this existing test coverage is extensive. Should I?

@bedevere-bot
Copy link

Thanks for making the requested changes!

@1st1: please review the changes made to this pull request.

@vstinner vstinner dismissed 1st1’s stale review July 12, 2018 10:27

The PR no longer uses sig.replace() but just: argspec = str(signature(object))

Copy link
Member

@vstinner vstinner left a comment

Choose a reason for hiding this comment

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

LGTM.

"./python -W error -m test test_docxmlrpc" now pass, so the PR fixed the issue that I reported.

test_docxmlrpc still pass which means that the HTML is not modified by this change.

@vstinner
Copy link
Member

@1st1: Would you mind to review again the change?

@miss-islington
Copy link
Contributor

Thanks @niconoe for the PR, and @vstinner for merging it 🌮🎉.. I'm working now to backport this PR to: 3.7.
🐍🍒⛏🤖

@bedevere-bot
Copy link

GH-8294 is a backport of this pull request to the 3.7 branch.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jul 16, 2018
Replace deprecated inspect.getfullargspec() with inspect.signature().
(cherry picked from commit 35c0809)

Co-authored-by: Nicolas Noé <[email protected]>
vstinner pushed a commit that referenced this pull request Jul 16, 2018
)

Replace deprecated inspect.getfullargspec() with inspect.signature().
(cherry picked from commit 35c0809)

Co-authored-by: Nicolas Noé <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants