Utils

Utilities to support functional programming in Python. For internal use only.

Copyright (c) 2024 - Eindhoven University of Technology, The Netherlands

This software is made available under the terms of the MIT License.

FuPy.utils.count_required_args(f: Callable[[...], Any]) int[source]

Count the minimum number of required non-keyword arguments of f. Does not work for built-in functions (use parameter r of Func to bypass this).

FuPy.utils.force(v: Any) Any[source]

Resume all suspended computations.

FuPy.utils.indent_lines(line: str, indentation: str = '', k: int = 0) str[source]

Indent each line by n spaces, except for the first k lines.

FuPy.utils.show_args(args: tuple[Any, ...]) str[source]

Show tuple as a string, with strings quoted, without trailing comma if singleton.

N.B. The singleton case does not occur in case of auto-(un)packing of arguments.

Used in tracing; so, avoid evaluation of lazy objects.

FuPy.utils.show_value(value) str[source]

Show value, quoting strings.

Used in tracing; so, avoid evaluation of lazy objects.