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

Detect bad list.append calls without a varname #522

Merged
merged 2 commits into from
Apr 14, 2022
Merged

Conversation

JelleZijlstra
Copy link
Contributor

No description provided.

return _check_generic_container(
"list.append", "object", ctx.vars["self"], lst, element, ctx, list
)
if isinstance(lst, GenericValue):
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This could alternatively be elif, which would allow us to append anything to a SequenceValue (i.e., unannotated) list. But I just ran this branch internally and only got three errors, all of which were fixable by adding explicit annotations. I think such annotations are helpful, so I'll stick with this logic.

@JelleZijlstra JelleZijlstra merged commit 5080a78 into master Apr 14, 2022
@JelleZijlstra JelleZijlstra deleted the listappend branch April 14, 2022 19:32
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.

None yet

1 participant