Skip to content
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

Better error message for incompatible default argument (take 2) #3783

Merged
merged 2 commits into from Jul 31, 2017

Conversation

Projects
None yet
2 participants
@elazarg
Copy link
Contributor

commented Jul 31, 2017

Reopen #3773

Rephrase 'incompatible default' message
Add tests for tuple parameter
@elazarg

This comment has been minimized.

Copy link
Contributor Author

commented Jul 31, 2017

@gvanrossum
Copy link
Member

left a comment

Please just fix the nit (remove no'), don't do anything else.

name = arg.variable.name()
msg = 'Incompatible default for '
if name.startswith('__tuple_arg_'):
msg += "tuple argument no' {}".format(name[12:])

This comment has been minimized.

Copy link
@gvanrossum

gvanrossum Jul 31, 2017

Member

Few people will understand argument no' 1 -- just get rid of the no' and make it argument 1 please.

@gvanrossum gvanrossum merged commit 6366a02 into python:master Jul 31, 2017

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@gvanrossum

This comment has been minimized.

Copy link
Member

commented Jul 31, 2017

Thanks! Next time it would be nice to have an issue before you start coding. :-)

@elazarg

This comment has been minimized.

Copy link
Contributor Author

commented Jul 31, 2017

Will do.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.