Skip to content

Commit ec9ac64

Browse files
committed
Remove explicit None check
1 parent 311f445 commit ec9ac64

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
@@ -2754,7 +2754,7 @@ def self_group(
27542754
self, against: Optional[OperatorType] = None
27552755
) -> ClauseElement:
27562756
if (
2757-
against is not None
2757+
against
27582758
and self.group
27592759
and operators.is_precedent(self.operator, against)
27602760
):
@@ -2783,7 +2783,7 @@ def self_group(
27832783
self, against: Optional[OperatorType] = None
27842784
) -> ColumnElement[Any]:
27852785
if (
2786-
against is not None
2786+
against
27872787
and self.group
27882788
and operators.is_precedent(self.operator, against)
27892789
or (
@@ -3623,7 +3623,7 @@ def self_group(
36233623
self, against: Optional[OperatorType] = None
36243624
) -> ColumnElement[Any]:
36253625
if (
3626-
against is not None
3626+
against
36273627
and self.operator
36283628
and operators.is_precedent(self.operator, against)
36293629
):
@@ -4360,9 +4360,7 @@ def over(
43604360
def self_group(
43614361
self, against: Optional[OperatorType] = None
43624362
) -> ColumnElement[_T]:
4363-
if against is not None and operators.is_precedent(
4364-
operators.filter_op, against
4365-
):
4363+
if against and operators.is_precedent(operators.filter_op, against):
43664364
return Grouping(self)
43674365
else:
43684366
return self

0 commit comments

Comments
 (0)