Skip to content

Commit 700ef78

Browse files
dbrattliclaude
andauthored
refactor(python): add ty suppression codes to existing type: ignores (#4639)
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 7e175dc commit 700ef78

4 files changed

Lines changed: 6 additions & 6 deletions

File tree

src/fable-library-py/fable_library/async_.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ def binder(_: Any | Unit = UNIT) -> Async[None]:
104104

105105
def parallel[T](computations: IEnumerable_1[Async[T]]) -> Async[Array[T]]:
106106
def delayed() -> Async[Array[T]]:
107-
tasks: Iterable[Awaitable[T]] = map(start_as_task, computations) # type: ignore[arg-type]
107+
tasks: Iterable[Awaitable[T]] = map(start_as_task, computations) # type: ignore[arg-type] # ty: ignore[invalid-assignment, invalid-argument-type]
108108
all: Future[list[T]] = asyncio.gather(*tasks)
109109

110110
def to_array(results: list[T]) -> Async[Array[T]]:

src/fable-library-py/fable_library/bases.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,10 @@ class StringableBase:
7171
__slots__ = ()
7272

7373
def __str__(self) -> str:
74-
return self.ToString() # type: ignore[attr-defined]
74+
return self.ToString() # type: ignore[attr-defined] # ty: ignore[unresolved-attribute]
7575

7676
def __repr__(self) -> str:
77-
return self.ToString() # type: ignore[attr-defined]
77+
return self.ToString() # type: ignore[attr-defined] # ty: ignore[unresolved-attribute]
7878

7979

8080
class EquatableBase(ABC):

src/fable-library-py/fable_library/core/array.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ class FSharpArray[T](MutableSequence[T]):
7474
# Instance methods (alphabetically sorted)
7575
def add_in_place(self, value: T) -> None: ...
7676
def add_range_in_place(self, values: Iterable[T]) -> None: ...
77-
def append(self, array2: FSharpArray[T], cons: FSharpCons[T] | None = None) -> FSharpArray[T]: ... # type: ignore[override]
77+
def append(self, array2: FSharpArray[T], cons: FSharpCons[T] | None = None) -> FSharpArray[T]: ... # type: ignore[override] # ty: ignore[invalid-method-override]
7878
def average(self, averager: IGenericAverager[T]) -> T: ...
7979
def average_by[U](self, projection: Callable[[T], U], averager: IGenericAverager[U]) -> U: ...
8080
def choose[U](self, chooser: Callable[[T], Option[U]], cons: FSharpCons[U] | None = None) -> FSharpArray[U]: ...

src/fable-library-py/fable_library/int32.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ def div_rem[T: SupportsInt](x: T, y: T, out: FSharpRef[T]) -> T: ...
2424

2525
def div_rem[T: SupportsInt](x: T, y: T, out: FSharpRef[T] | None = None) -> T | tuple[T, T]:
2626
# Rust wrapper types already use truncated division and remainder
27-
q = x // y # type: ignore[operator]
28-
r = x % y # type: ignore[operator]
27+
q = x // y # type: ignore[operator] # ty: ignore[unsupported-operator]
28+
r = x % y # type: ignore[operator] # ty: ignore[unsupported-operator]
2929
if out is None:
3030
return (q, r)
3131
out.contents = r

0 commit comments

Comments
 (0)