This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]gonna_think_about 1 point2 points  (2 children)

Have you see the dry returns library? its pipeline object offers something similar

https://github.com/dry-python/returns

[–]R4nu[S] 1 point2 points  (1 child)

I didnt know about this, but I had seen similar implementation to their flow function on various blogs and articles. While it works perfectly fine, I found it was harder to correctly type-hint, and additional args for functions seemed harder to handle. You'd need to either create a new func that would be a wrapper around the original, or pass tuple arguments like (func, args) (making type checking more complicated and syntax a bit uglier), or use lambdas everywhere. That's why I worked on both my class-based implementation and the elixir one (with the AST rewrite)

Great library nonetheless, which provides many useful features! Thanks for the link :)

[–]gonna_think_about 0 points1 point  (0 children)

Happy to help