4 ms·
Yeah, functions have those advantages. That's why Python also has slice(), which you can then apply to any list, in a composable way. But when you don't need th
by icebraining 10y ago
Yeah, functions have those advantages. That's why Python also has slice(), which you can then apply to any list, in a composable way. But when you don't need those features, the splicing syntax adds less crud than a bunch of function with non-obvious names.
Eg. use of slice():
>>> butLast = slice(-1)
>>> getitem([7, 8, 9], butLast)
[7, 8]
- madmax96 10y ago> But when you don't need those features Ah, in a purely functional language you always need those features :)