Skip to content

Commit fa1c9b5

Browse files
committed
Update array.py
1 parent a8e6410 commit fa1c9b5

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

philh_myftp_biz/array.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from typing import Callable, Self, Any
1+
from typing import Callable, Self, Any, Iterator
22

33
#========================================================
44

@@ -10,10 +10,9 @@ class List[V]:
1010
"""
1111

1212
def __init__(self,
13-
a: 'list[V] | tuple[V] | filter[V] | Self[V]' = []
13+
a: Iterator[V] = []
1414
):
1515
from .file import PKL, temp
16-
from builtins import filter
1716
from .classOBJ import path
1817

1918
if isinstance(a, List):
@@ -22,7 +21,7 @@ def __init__(self,
2221
elif hasattr(a, 'read') and hasattr(a, 'save'):
2322
self.var = a
2423

25-
elif isinstance(a, (list, tuple, filter, range)):
24+
elif isinstance(a, Iterator):
2625
self.var = PKL(
2726
temp('array', 'pkl'),
2827
default = list(a)
@@ -126,10 +125,7 @@ def filtered(self,
126125
) -> Self[V]:
127126
from builtins import filter
128127

129-
return List(filter(
130-
function = func,
131-
iterable = self.read()
132-
))
128+
return List(filter(func, self.read()))
133129

134130
def filter(self,
135131
func: Callable[[V], Any] = lambda x: x

0 commit comments

Comments
 (0)