Skip to content

bpo-33582: Emit deprecation warning for formatargspec #6994

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

Merged
merged 3 commits into from
Jun 11, 2018

Conversation

Carreau
Copy link
Contributor

@Carreau Carreau commented May 19, 2018

Also assert it emits deprecation warnings in corresponding test, and add that into the docstring.

https://bugs.python.org/issue33582

@Carreau Carreau force-pushed the deprecated-formatargspec branch from 0033e03 to bddb788 Compare May 21, 2018 21:22
Copy link
Contributor

@taleinat taleinat left a comment

Choose a reason for hiding this comment

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

Just two minor fixes before this can go in, IMO.

Lib/inspect.py Outdated
function to format the sequence of arguments."""
function to format the sequence of arguments.

Deprecated since Python 3.5 use, the `signature` function and `Signature`
Copy link
Contributor

Choose a reason for hiding this comment

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

IMO there should be a colon : before the word "use" and no comma after it.

@@ -712,7 +712,8 @@ def assertArgSpecEquals(self, routine, args_e, varargs_e=None,
self.assertEqual(varkw, varkw_e)
self.assertEqual(defaults, defaults_e)
if formatted is not None:
self.assertEqual(inspect.formatargspec(args, varargs, varkw, defaults),
with self.assertWarns(DeprecationWarning):
self.assertEqual(inspect.formatargspec(args, varargs, varkw, defaults),
Copy link
Contributor

Choose a reason for hiding this comment

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

Please fix the indentation of the continuation line here and further in this file.

@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.

@Carreau Carreau force-pushed the deprecated-formatargspec branch from f1bfa0b to 7ff49d6 Compare June 11, 2018 12:35
@Carreau Carreau force-pushed the deprecated-formatargspec branch from 7ff49d6 to b0e3d14 Compare June 11, 2018 12:35
@Carreau
Copy link
Contributor Author

Carreau commented Jun 11, 2018

I have made the requested changes; please review again

@bedevere-bot
Copy link

Thanks for making the requested changes!

@methane, @taleinat: please review the changes made to this pull request.

@ned-deily
Copy link
Member

OK, let's get this in for 3.7.0.

@ned-deily ned-deily merged commit 46c5cd0 into python:master Jun 11, 2018
@miss-islington
Copy link
Contributor

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

@bedevere-bot
Copy link

GH-7645 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 Jun 11, 2018
(cherry picked from commit 46c5cd0)

Co-authored-by: Matthias Bussonnier <[email protected]>
miss-islington added a commit that referenced this pull request Jun 11, 2018
(cherry picked from commit 46c5cd0)

Co-authored-by: Matthias Bussonnier <[email protected]>
@Carreau
Copy link
Contributor Author

Carreau commented Jun 12, 2018

Thanks !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants