Replies: 2 comments
-
May be a good idea to share some hypothetical example code snippets see see how well they would work in Python codebases and explore the possible API design |
Beta Was this translation helpful? Give feedback.
-
Sure, that sounds like a good idea. To start off, https://github.com/EntilZha/PyFunctional Has many code samples that outline the rough style with key differences. I would imagine that rustedpy's implementation would adhere more closely to the naming style of Rust, and use a proper Optional type that can be a specialization of the Result type. from iter import Iter
integers = range(100)
odds_squared = (
Iter(integers)
.filter(is_odd)
.map(square)
.collect(list)
) Initial implementation would likely be in terms of the python builtins map and filter. So this, like PyFunctional is an ergonomic mechanism for processing data. |
Beta Was this translation helpful? Give feedback.
-
Is there active interest in bringing Map and Filter to rustedpy, possibly under a new repo.
This reminds me of https://github.com/EntilZha/PyFunctional
Many of the implementations are straightforward. It would leverage built-ins as often as possible with the added fluent interface method chaining.
I could take on some of these. I have experience in using
mypy
to type hint them as well. I would imagine future progress would be contingent onresult
reaching some critical state, but I thought it was worth asking nonetheless.Beta Was this translation helpful? Give feedback.
All reactions