PsiElement (@NotNull PyExpression expression, @NotNull Field field) { final PsiElement prepared = super.prepareExpressionToInject(expression, field); if (prepared == null) return null; // You cannot access attributes on numeric literals without wrapping them in parentheses if (!field.getAttributesAndLookups().isEmpty() && (prepared instanceof PyBinaryExpression || prepared instanceof PyPrefixExpression || prepared instanceof PyNumericLiteralExpression)) { return wrapExpressionInParentheses(prepared); } return prepared; }