GitHub - willhyper/pyplin: overloading __or__ operator to implement pipe · GitHub
Skip to content

willhyper/pyplin

Folders and files

Repository files navigation

pipe!

Write Python the functional way

from pyplin import pipe
from math import sqrt
import numpy as np

v1 = np.array((1, 1))
v2 = np.array((4, 5))

d = v1 - v2
r = pipe(d) | (lambda x : x*x) | sum | sqrt
assert r.value == 5.0
r | print # 5.0

About

overloading __or__ operator to implement pipe

Resources

Stars

Watchers

Forks

Packages

Contributors

Languages