-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
join
util
#13
Comments
Hey, Some things for discussion:
Let me know what you think. |
I don't see this as a problem. It's not usual to have multiple
It doesn't bother me. I used something equivalent in Java for years. Maybe it's just a matter of familiarity / getting used to it? :man_shrugging:
I wonder if this wouldn't be a little too magical? 🤔 And in some cases the string conversion would happen more than once. If you perform the conversion yourself, e.g.: | foreach('-{}-')
| ', '.join by the time the code reached the |
PS: Sorry for the huge delay in the reply. PPS: Thank you for the project. It changed my life. Seriously. When I first learned about it, I was like: "Where have you been my entire life?!" |
No worries, there's no rush ;) I'm glad you find the library useful! About the Think something like: In [1]: orders > join(users, X.user_id, X.id) | list
Out[1]: [([order1, order2], [user1]),
([order3], [user2])] Maybe About automatically converting to string before |
I'd like to propose a new
join
util.The idea is simple: it calls
foreach(str)
before callingstr.join
. So, whenever you have something likeyou can replace it with
You can customize the string conversion by passing either a function or a format string as the second parameter, e.g.:
Implementation
Tests
The text was updated successfully, but these errors were encountered: