PsiElement (@NotNull PyBinaryExpression containedExpression) { assert myPosition >= 0; PyExpression left = containedExpression.getLeftExpression(); PyExpression right = containedExpression.getRightExpression(); if (left instanceof PyParenthesizedExpression) { PyExpression leftTuple = PyPsiUtils.flattenParens(left); if (leftTuple instanceof PyTupleExpression) { PyExpression[] leftTupleElements = ((PyTupleExpression)leftTuple).getElements(); int leftTupleLength = leftTupleElements.length; if (leftTupleLength > myPosition) { return leftTupleElements[myPosition]; } if (right instanceof PyTupleExpression) { PyExpression[] rightTupleElements = ((PyTupleExpression)right).getElements(); int rightLength = rightTupleElements.length; if (leftTupleLength + rightLength > myPosition) return rightTupleElements[myPosition - leftTupleLength]; } } } return containedExpression; }