Skip to content

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

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 2 commits into from
Jul 31, 2017

Conversation

elazarg
Copy link
Contributor

@elazarg elazarg commented Jul 31, 2017

Reopen #3773

Add tests for tuple parameter
@elazarg
Copy link
Contributor Author

elazarg commented Jul 31, 2017

@gvanrossum

Copy link
Member

@gvanrossum gvanrossum left a comment

Choose a reason for hiding this comment

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

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

mypy/checker.py Outdated
name = arg.variable.name()
msg = 'Incompatible default for '
if name.startswith('__tuple_arg_'):
msg += "tuple argument no' {}".format(name[12:])
Copy link
Member

Choose a reason for hiding this comment

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

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
@gvanrossum
Copy link
Member

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

@elazarg
Copy link
Contributor Author

elazarg commented Jul 31, 2017

Will do.

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.

2 participants