Re:Show HN: Pyper – Concurrent Python Made Simple
by Rickster35 on Wednesday January 15, 2025 @09:51AM
(#42711416)
Yeah, this seems neatest if you don't like line breaks
pipeline = (
task(get_data, branch=True)
| task(step1, workers=20)
| task(step2, workers=20)
| task(step3, workers=20, multiprocess=True)
)Square brackets would create a list and braces would create a set of course. The contents still can be split over different lines-- just pointing that this syntax doesn't do the same thing.
Re:Show HN: Pyper – Concurrent Python Made Simple
by asplake on Wednesday January 15, 2025 @10:21AM
(#42711843)
The example at https://pyper-dev.github.io/pyper/docs/Examples/ChessDataAna... does exactly that.
Re:Show HN: Pyper – Concurrent Python Made Simple
by giancarlostoro on Wednesday January 15, 2025 @09:58AM
(#42711507)
Yeah I should have noted that they behave the same in terms of cleaning up a line, not necessarily in terms of what the compiler will do with each token pair.
I've not been doing Python day-to-day so I'm starting to lose my touch on all the nice little tricks.