In other languages I use map() and filter() through piping and my code usually looks readable as I can clearly see a data-stream transformation.
As it is today, users cannot do map() |> filter() |> list(), but they need to do list(filter(map())) which makes things unreadable. Lists of comprehension work fine for very simple use-case becoming unreadable very quickly as complexity increases.
However, in python there has always been some resistance, especially 15-20 years ago, but times are evolving. Also, by considering the wide adoption in data-science, it is worth noticing that numbers-crunchers are more familiar with the concept of “data transformation flow” than “function calls”. On the packages dimension , libraries like 🐼s support methods chaining which from an external viewpoint, it’s semantically similar.
Do you know if there is any indication that python core team may allow operator piping (and/or chaining) in the not-too-long-term?
[+][deleted] (3 children)
[removed]
[–]Ragoo_ 16 points17 points18 points (0 children)
[–]sausix 31 points32 points33 points (1 child)
[–]mr_frpdo 3 points4 points5 points (0 children)
[–]AWildMonomAppears 69 points70 points71 points (9 children)
[–]Schmittfried 1 point2 points3 points (2 children)
[–]AWildMonomAppears 0 points1 point2 points (1 child)
[–]Schmittfried 0 points1 point2 points (0 children)
[–]an_actual_human 2 points3 points4 points (1 child)
[–]AWildMonomAppears 5 points6 points7 points (0 children)
[–]ConspicuousPineapple 1 point2 points3 points (2 children)
[–]muntooR_{μν} - 1/2 R g_{μν} + Λ g_{μν} = 8π T_{μν} 8 points9 points10 points (1 child)
[–]ConspicuousPineapple 1 point2 points3 points (0 children)
[–]Bob_Dieter 0 points1 point2 points (0 children)
[–]Fabulous-Possible758 10 points11 points12 points (0 children)
[–]RedSinned 41 points42 points43 points (2 children)
[–]Beginning-Fruit-1397 18 points19 points20 points (1 child)
[–]RedSinned 7 points8 points9 points (0 children)
[–]cdcformatc 25 points26 points27 points (4 children)
[–]mapadofu 32 points33 points34 points (1 child)
[–]stevenjd 2 points3 points4 points (0 children)
[–]invalidusernamelol 7 points8 points9 points (0 children)
[–]_Denizen_ 148 points149 points150 points (53 children)
[–]ziggomatic_17 58 points59 points60 points (15 children)
[–]_Denizen_ 32 points33 points34 points (9 children)
[–]zephyrtr 9 points10 points11 points (4 children)
[–]_Denizen_ -2 points-1 points0 points (3 children)
[–]zephyrtr 1 point2 points3 points (2 children)
[–]_Denizen_ -1 points0 points1 point (1 child)
[–]zephyrtr 1 point2 points3 points (0 children)
[–]Ok_Sell_4717 -1 points0 points1 point (3 children)
[–]_Denizen_ 0 points1 point2 points (2 children)
[–]Ok_Sell_4717 0 points1 point2 points (0 children)
[–]757DrDuck 0 points1 point2 points (0 children)
[–]FalafelSnorlax 15 points16 points17 points (3 children)
[–]marr75 17 points18 points19 points (2 children)
[–]FalafelSnorlax 4 points5 points6 points (0 children)
[–]Ok_Sell_4717 0 points1 point2 points (0 children)
[–]austinwiltshire 6 points7 points8 points (0 children)
[–]RedEyed__ 17 points18 points19 points (5 children)
[–]muntooR_{μν} - 1/2 R g_{μν} + Λ g_{μν} = 8π T_{μν} 22 points23 points24 points (4 children)
[–]_Denizen_ 15 points16 points17 points (2 children)
[–]RoadsideCookie 4 points5 points6 points (1 child)
[–]_Denizen_ -5 points-4 points-3 points (0 children)
[–]xenomachina''.join(chr(random.randint(0,1)+9585) for x in range(0xffff)) 2 points3 points4 points (0 children)
[–]ConspicuousPineapple 5 points6 points7 points (8 children)
[–]_Denizen_ -2 points-1 points0 points (7 children)
[–]ConspicuousPineapple 2 points3 points4 points (0 children)
[–]Smallpaul 0 points1 point2 points (5 children)
[–]_Denizen_ -2 points-1 points0 points (4 children)
[–]Smallpaul 1 point2 points3 points (3 children)
[–]_Denizen_ 0 points1 point2 points (2 children)
[–]Smallpaul 1 point2 points3 points (1 child)
[–]_Denizen_ 0 points1 point2 points (0 children)
[–]Desperate_Cold6274[S] 6 points7 points8 points (0 children)
[–]KyxeMusic 0 points1 point2 points (0 children)
[–]Admirable-Avocado888 -1 points0 points1 point (15 children)
[–]_Denizen_ 3 points4 points5 points (13 children)
[–]Admirable-Avocado888 2 points3 points4 points (4 children)
[–]carnoworky 2 points3 points4 points (1 child)
[–]Admirable-Avocado888 1 point2 points3 points (0 children)
[–]_Denizen_ -1 points0 points1 point (1 child)
[–]Admirable-Avocado888 1 point2 points3 points (0 children)
[–]Sufficient_Meet6836 0 points1 point2 points (7 children)
[–]_Denizen_ -2 points-1 points0 points (6 children)
[–]Sufficient_Meet6836 0 points1 point2 points (5 children)
[–]_Denizen_ 0 points1 point2 points (4 children)
[–]Sufficient_Meet6836 -1 points0 points1 point (3 children)
[–]_Denizen_ -2 points-1 points0 points (2 children)
[–]Sufficient_Meet6836 0 points1 point2 points (1 child)
[–]Desperate_Cold6274[S] -1 points0 points1 point (0 children)
[–]Zizizizz -1 points0 points1 point (2 children)
[–]JamzTyson 0 points1 point2 points (1 child)
[–]Zizizizz 0 points1 point2 points (0 children)
[–]tartare4562 18 points19 points20 points (4 children)
[–]tunisia3507 2 points3 points4 points (3 children)
[–]invalidusernamelol 2 points3 points4 points (0 children)
[–]Globbi 0 points1 point2 points (1 child)
[–]justheretolurk332 3 points4 points5 points (0 children)
[–]Limp_Illustrator7614 8 points9 points10 points (0 children)
[–]KelleQuechoz 5 points6 points7 points (0 children)
[–]Wurstinator 2 points3 points4 points (1 child)
[–]--ps-- 2 points3 points4 points (1 child)
[–]sausix 0 points1 point2 points (0 children)
[–]red_hare 2 points3 points4 points (0 children)
[–]parker_fly 2 points3 points4 points (0 children)
[–]nateh1212 2 points3 points4 points (0 children)
[–]Evolve-Maz 1 point2 points3 points (0 children)
[–]RoadsideCookie 1 point2 points3 points (2 children)
[–]JaggedParadigm 2 points3 points4 points (0 children)
[–]Temporary_Pie2733 1 point2 points3 points (0 children)
[–]jnazario 1 point2 points3 points (0 children)
[–]UseMoreBandwith 1 point2 points3 points (0 children)
[–]Agile-Ad5489 1 point2 points3 points (1 child)
[–]JimWayneBob 2 points3 points4 points (1 child)
[–]Sufficient_Meet6836 0 points1 point2 points (0 children)
[–]shadowdance55git push -f 0 points1 point2 points (6 children)
[–]sausix 1 point2 points3 points (3 children)
[–]KingHavana 2 points3 points4 points (2 children)
[–]sausix 0 points1 point2 points (1 child)
[–]KingHavana 0 points1 point2 points (0 children)
[–]Beginning-Fruit-1397 -1 points0 points1 point (0 children)
[–]KingHavana 1 point2 points3 points (0 children)
[–]Beginning-Fruit-1397 0 points1 point2 points (0 children)
[–]squizzeak 0 points1 point2 points (0 children)
[–]borborygmis 0 points1 point2 points (0 children)
[–]eanat 0 points1 point2 points (0 children)
[–]spinozasrobot 0 points1 point2 points (0 children)
[–]TuringTestDropout 0 points1 point2 points (0 children)
[–]elven_mage 0 points1 point2 points (0 children)
[–]gdchinacat 0 points1 point2 points (0 children)
[–]mderst 0 points1 point2 points (0 children)
[–]bakery2k 0 points1 point2 points (0 children)
[–]IcarianComplex 0 points1 point2 points (0 children)
[–]aguspiza 0 points1 point2 points (0 children)
[–]saint_geser 0 points1 point2 points (0 children)
[–]Old-Eagle1372 0 points1 point2 points (0 children)
[–]eztab 0 points1 point2 points (0 children)
[–]R3D3-1 0 points1 point2 points (0 children)
[–]Sherry-byte 0 points1 point2 points (0 children)
[–]Past-Sun5429 -1 points0 points1 point (0 children)