fix: external pylib bugs

This commit is contained in:
Shunsuke Shibayama 2023-12-06 18:31:03 +09:00
parent 20935796fd
commit fb0248fdf1
7 changed files with 41 additions and 5 deletions

View file

@ -9,15 +9,21 @@
ndim: Nat
dtype: Type
size: Nat
copy: |T, S: [Nat; _]|(self: .NDArray(T, S),) -> .NDArray(T, S)
reshape: |T, Old: [Nat; _], S: [Nat; _]|(
self: .NDArray(T, Old),
shape: {S},
) -> .NDArray(T, S)
sum: |T <: Num|(self: .NDArray(T, _),) -> T
take: (|T|(self: .NDArray(T, _), indice: Nat) -> T) \
and (|T|(self: .NDArray(T, _), indices: .NDArray(Nat) or [Nat; _]) -> .NDArray(T, _))
tobytes: |T|(self: .NDArray(T, _),) -> Bytes
tolist: |T|(self: .NDArray(T, _),) -> [T; _]
.nan: Float
.Nan: Float
.abs: |T|(object: .NDArray(T),) -> .NDArray(T)
.abs: |T, S: [Nat; _]|(object: .NDArray(T, S),) -> .NDArray(T, S)
.add: |T, S: [Nat; _]|(object: .NDArray(T, S), other: .NDArray(T, S)) -> .NDArray(T, S)
.all: |T <: Num|(object: .NDArray(T),) -> Bool
.any: |T <: Num|(object: .NDArray(T),) -> Bool

View file

@ -1,7 +1,6 @@
.Tqdm! = 'tqdm': (T: Type) -> ClassType
.Tqdm!(T) <: Iterable T
.Tqdm!(T).
# TODO: iterable should be Comparable
__call__: (
iterable: Iterable(T),
desc := Str,
@ -30,3 +29,5 @@
delay := Float,
gui := Bool,
) -> .Tqdm!(T)
.tqdm = .Tqdm!.__call__