2 May
2017
2 May
'17
5:10 a.m.
Steven D’Aprano was giving me an idea (in the bytes.hex delimiter discussion): I had very often the use case that I want to split sequences into subsequences of same size. How about adding a chunks() and rchunks() function to sequences: [1,2,3,4,5,6,7].chunks(3) => [[1,2,3], [4,5,6], [7]] "1234“.chunks(2) => [“12“, “34“] (this could then be used to emulate stevens proposal: “ “.join(“1234567“.chunks(2)) => “12 34 56 7“) robert