Skip to content

overloading __or__ operator to implement pipe

Notifications You must be signed in to change notification settings

willhyper/pyplin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

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

No packages published

Languages