| 3127 | return operators.is_comparison(self.operator) |
| 3128 | |
| 3129 | def self_group( |
| 3130 | self, against: Optional[OperatorType] = None |
| 3131 | ) -> Union[Self, Grouping[_T]]: |
| 3132 | if ( |
| 3133 | self.group |
| 3134 | and operators.is_precedent(self.operator, against) |
| 3135 | or ( |
| 3136 | # a negate against a non-boolean operator |
| 3137 | # doesn't make too much sense but we should |
| 3138 | # group for that |
| 3139 | against is operators.inv |
| 3140 | and not operators.is_boolean(self.operator) |
| 3141 | ) |
| 3142 | ): |
| 3143 | return Grouping(self) |
| 3144 | else: |
| 3145 | return self |
| 3146 | |
| 3147 | @property |
| 3148 | def _flattened_operator_clauses( |