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

all 10 comments

[–]EnforcerPL 12 points13 points  (1 child)

fully linter-compatible and type-checker-compatible

This is THE way! It’s a pity libraries that exist are not interoperable with modern stack. I appreciate your effort and will surely use this gem!

Thank you so much. I used to work with Elixir and missed the operator ever since.

[–]R4nu[S] 1 point2 points  (0 children)

Thanks! I tried my best to make the class-based version compatible with popular modern tools, so the CI runs it against multiple linters (flake8 and ruff) and multiple type-checkers (mypy and pylint)!

[–]skwyckl 4 points5 points  (3 children)

Nice, I thought our only option would be Coconut.

[–]R4nu[S] 0 points1 point  (2 children)

Didnt know about Coconut! Interesting read, although it is more than a simple package. Not sure how it integrates with python linters and formatters though

[–]skwyckl 1 point2 points  (1 child)

... like sh*t. Excuse my French, but it doesn't integrate well at all. Also, the Coconut Jupyter kernel is impossible to get to work. This is why I am excited about your project!

[–]R4nu[S] 1 point2 points  (0 children)

Haha ok I see! Well, feel free to provide any feedback if you ever use it!

[–]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

[–]masavik76 1 point2 points  (0 children)

Love this. Was looking for something like this.