Skip to content

Commit

Permalink
Don't use private attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
WyattBlue committed Sep 24, 2023
1 parent f1e788f commit feab9ec
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions auto_editor/lang/palet.py
Original file line number Diff line number Diff line change
Expand Up @@ -682,19 +682,19 @@ def vector_extend(vec: list, *more_vecs: list) -> None:

def palet_map(proc: Proc, seq: str | list | range | NDArray) -> Any:
if type(seq) is str:
return str(map(proc.proc, seq))
return str(map(proc, seq))
if isinstance(seq, (list, range)):
return list(map(proc.proc, seq))
return list(map(proc, seq))

if isinstance(seq, np.ndarray):
if proc.arity[0] != 0:
raise MyError("map: procedure must take at least one arg")
check_args(proc.name, [0], (1, 1), None)
return proc.proc(seq)
return proc(seq)


def apply(proc: Proc, seq: str | list | range) -> Any:
return reduce(proc.proc, seq)
return reduce(proc, seq)


def ref(seq: Any, ref: int) -> Any:
Expand Down

0 comments on commit feab9ec

Please sign in to comment.