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

Include more descriptions of types in error messages #125

Closed
JukkaL opened this issue Feb 8, 2013 · 0 comments
Closed

Include more descriptions of types in error messages #125

JukkaL opened this issue Feb 8, 2013 · 0 comments
Labels

Comments

@JukkaL
Copy link
Collaborator

JukkaL commented Feb 8, 2013

Consider this code fragment:

s = 'x'
n = 1
s = n  # type check fails

The error message is Incompatible types in assignment or somesuch which is just plain uninformative. Say something like Cannot assign 'int' to 'str' instead. When the types are inferred, it might not be immediately obvious why an assignment is rejected.

There is also a similar issue with function argument types. Include both the actual and the expected type.

Shorten the types whenever possible to only include enough information to make the problem clear and obvious. So

Cannot assign func<...very long...> to tuple<...very long...>

is worse than

Cannot assign function to tuple.

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

No branches or pull requests

1 participant