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

Call value ternary #1501

Merged
merged 8 commits into from
Jan 5, 2023
Merged

Call value ternary #1501

merged 8 commits into from
Jan 5, 2023

Conversation

0xalpharush
Copy link
Contributor

@0xalpharush 0xalpharush commented Dec 12, 2022

@0xalpharush 0xalpharush marked this pull request as ready for review December 12, 2022 18:46
if isinstance(next_expr.expression_right, ConditionalExpression):
next_expr = _handle_ternary_access(
next_expr, true_expression, false_expression
# TODO: can we get rid of `NoneType` expressions in `TupleExpression`?
Copy link
Member

Choose a reason for hiding this comment

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

Not sure, my intuition tells me that could happen with unnamed tuple (ex: (,,,) = f()). Through I haven't tested, so I could be wrong

self.copy_expression(
next_expr, true_expression.expression, false_expression.expression
)

# pylint: disable=too-many-nested-blocks
Copy link
Member

Choose a reason for hiding this comment

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

Can we move part of the function's logic into internal functions?

This would reduce the code complexity, and allows us to remove this warning

@0xalpharush 0xalpharush requested a review from montyly January 3, 2023 21:52
@montyly montyly merged commit 81c2a46 into dev Jan 5, 2023
@montyly montyly deleted the call-value-ternary branch January 5, 2023 10:19
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