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

Make ARG_* into an actual enum class instead of just using int everywhere #10789

Merged
merged 2 commits into from
Jul 9, 2021

Conversation

msullivan
Copy link
Collaborator

This is cleaner and more precise and will allow us to add convenience
methods to the class.
(I added one convenience method so far, to verify that mypyc doesn't
choke on it...)

…here

This is cleaner and more precise and will allow us to add convenience
methods to the class.
(I added one convenience method so far, to verify that mypyc doesn't
choke on it...)
mypy/nodes.py Outdated Show resolved Hide resolved
self.type = typ
self.unanalyzed_type = typ
self.is_overload = False
self.is_generator = False
self.is_generator: bool = False
Copy link
Member

Choose a reason for hiding this comment

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

Why add the type to only this field? Just curious

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Because something about making some of the things ArgKind's prompted __init__ to get deferred, I'd guess, which meant that the fields weren't all inferred properly, and this is one of the ones that got caught up in a problem with one of the use sites. I annotated some more to make it less weird, but sigh.

@msullivan msullivan merged commit 3552971 into master Jul 9, 2021
@msullivan msullivan deleted the arg_enum branch July 9, 2021 20:04
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