Skip to content

Commit b31e72c

Browse files
committed
Remove explicit None check
1 parent 3748e7c commit b31e72c

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

lib/sqlalchemy/sql/elements.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2760,7 +2760,7 @@ def self_group(
27602760
self, against: Optional[OperatorType] = None
27612761
) -> ClauseElement:
27622762
if (
2763-
against is not None
2763+
against
27642764
and self.group
27652765
and operators.is_precedent(self.operator, against)
27662766
):
@@ -2789,7 +2789,7 @@ def self_group(
27892789
self, against: Optional[OperatorType] = None
27902790
) -> ColumnElement[Any]:
27912791
if (
2792-
against is not None
2792+
against
27932793
and self.group
27942794
and operators.is_precedent(self.operator, against)
27952795
or (
@@ -3654,7 +3654,7 @@ def self_group(
36543654
self, against: Optional[OperatorType] = None
36553655
) -> ColumnElement[Any]:
36563656
if (
3657-
against is not None
3657+
against
36583658
and self.operator
36593659
and operators.is_precedent(self.operator, against)
36603660
):
@@ -4393,9 +4393,7 @@ def over(
43934393
def self_group(
43944394
self, against: Optional[OperatorType] = None
43954395
) -> ColumnElement[_T]:
4396-
if against is not None and operators.is_precedent(
4397-
operators.filter_op, against
4398-
):
4396+
if against and operators.is_precedent(operators.filter_op, against):
43994397
return Grouping(self)
44004398
else:
44014399
return self

0 commit comments

Comments
 (0)