From: Yurii Karabas <1998uriyyo@gmail.com> Date: Sun, 19 Mar 2023 10:19:36 +0000 (+0200) Subject: Fix lint issues X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b54c1fa5de226b89fdf0dd832357408d8394a5f2;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git Fix lint issues --- diff --git a/lib/sqlalchemy/dialects/postgresql/ranges.py b/lib/sqlalchemy/dialects/postgresql/ranges.py index a1dfb1409c..bc83367fec 100644 --- a/lib/sqlalchemy/dialects/postgresql/ranges.py +++ b/lib/sqlalchemy/dialects/postgresql/ranges.py @@ -642,17 +642,18 @@ class Range(Generic[_T]): return self.difference(other) def intersection(self, other: Range[_T]) -> Range[_T]: - """Compute the intersection of this range with the `other`. - """ + """Compute the intersection of this range with the `other`.""" if self.empty or other.empty or not self.overlaps(other): return Range(empty=True) slower = self.lower + slower_b = self.bounds[0] supper = self.upper - slower_b, supper_b = self.bounds + supper_b = self.bounds[1] olower = other.lower + olower_b = other.bounds[0] oupper = other.upper - olower_b, oupper_b = other.bounds + oupper_b = other.bounds[1] if self._compare_edges(slower, slower_b, olower, olower_b) < 0: rlower = olower @@ -668,7 +669,11 @@ class Range(Generic[_T]): rupper = supper rupper_b = supper_b - return Range(rlower, rupper, bounds=cast(_BoundsType, rlower_b + rupper_b)) + return Range( + rlower, + rupper, + bounds=cast(_BoundsType, rlower_b + rupper_b), + ) def __mul__(self, other: Range[_T]) -> Range[_T]: return self.intersection(other) @@ -846,7 +851,7 @@ class AbstractRange(sqltypes.TypeEngine[Range[_T]]): Will raise an exception if the resulting range is not contiguous. """ - return self.expr.op("*")(other) + return self.expr.op("*")(other) # type: ignore __mul__ = intersection