Open
Description
The type hints described in PEP-484 provide a convenient way to reason about code, and make it possible for static type checkers like mypy to catch type-mismatch errors.
Here is an example of how static type checking might be able to fit in with the toolz library:
Suppose f
and g
are typed functions defined as follows:
def f(x: A) -> B:
...
def g(y: B) -> C:
...
Since f
is Callable[[A], B]
and g
is Callable[[B], C]
, one would expect the composite toolz.compose(g, f)
to be Callable[[A], C]
. (Here I am using the Callable
protocol from the typing module).
Of course, implementing this could be tricky.
Metadata
Metadata
Assignees
Labels
No labels