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

Give a better error message for incorrectly typed default arguments #3588

Closed
ddfisher opened this issue Jun 21, 2017 · 1 comment
Closed

Comments

@ddfisher
Copy link
Collaborator

Currently, a type error in the default value for an argument results in a generic Incompatible types in assignment (expression has type "X", variable has type "Y") error. As @gvanrossum pointed out in #3248, this deserves a special error such as: Default for argument XXX is incompatible with its type (expression has type "X", argument has type "Y").

@ilevkivskyi
Copy link
Member

This is already fixed, there is now a nice error:

Incompatible default for argument "x" (default has type "int", argument has type "str")

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

No branches or pull requests

2 participants