Skip to content
Myr

Narrow down type ignore

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Refs: https://github.com/pallets/click/pull/3371#discussion_r3140274565

authored by Andreas Backx · committed by Kevin Deldycke · parent 5989375 · Browse files · 1 file+10 added−8 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Trailers

  • Co-authored-by: Kevin Deldycke <kevin@deldycke.com>

Diff stats

1 file+10 added−8 removed

  • other:+10 added−8 removed

1 file+10 added−8 removed

modified:src/click/types.py+10 added-8 removed
542 unmodified lines
543 ) -> ParamTypeValue:544 import operator545546 rv = super().convert(value, param, ctx)547 min = self.min548 max = self.max547 lt_min: bool = self.min is not None and (549 lt_min: bool = min is not None and (550 operator.le if self.min_open else operator.lt549 )(rv, self.min) # type: ignore[arg-type]550 gt_max: bool = self.max is not None and (551 )(rv, min) # type: ignore[arg-type]552 gt_max: bool = max is not None and (553 operator.ge if self.max_open else operator.gt552 )(rv, self.max) # type: ignore[arg-type]554 )(rv, max) # type: ignore[arg-type]555556 if self.clamp:555 if lt_min:556 return self._clamp(self.min, 1, self.min_open) # type: ignore557 if min is not None and lt_min:558 return self._clamp(min, 1, self.min_open) # type: ignore[arg-type]559558 if gt_max:559 return self._clamp(self.max, -1, self.max_open) # type: ignore560 if max is not None and gt_max:561 return self._clamp(max, -1, self.max_open) # type: ignore[arg-type]562563 if lt_min or gt_max:564 self.fail(565 _("{value} is not in the range {range}.").format(
690 unmodified lines