Skip to content

Preserve the name of first argument in methods when serializing #5109

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
May 26, 2018

Conversation

ilevkivskyi
Copy link
Member

This is useful to give nicer error messages after serialization.

This is a step towards #4772
Unblocks #1412 (much faster pythoneval tests).

@emmatyping
Copy link
Member

The lint issue seemed minor so I went ahead and fixed it. I can confirm this solves the issue I came across in #1412!

@ilevkivskyi ilevkivskyi requested review from JukkaL and gvanrossum May 25, 2018 04:35
Copy link
Collaborator

@msullivan msullivan left a comment

Choose a reason for hiding this comment

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

A good start on the infrastructure for this.

Updating the interface hashing is going to be annoying. One kind of hacky approach would be after formatting the json, traverse the serialized tree sanitizing it by deleting def_extras, then hash the formatting of that.

mypy/types.py Outdated
bound_args=[(None if t is None else deserialize_type(t))
for t in data['bound_args']],
)
call_type.def_extras = data['def_extras']
Copy link
Collaborator

Choose a reason for hiding this comment

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

Would it be cleaner to add def_extras to the __init__?

@ilevkivskyi ilevkivskyi merged commit c9a5d56 into python:master May 26, 2018
@ilevkivskyi ilevkivskyi deleted the fix-orig-function branch May 26, 2018 16:27
@ilevkivskyi
Copy link
Member Author

@ethanhs You can now go ahead with your #1412 fix.

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.

3 participants