5 ms·
It's pretty clear if you're intimately familiar with Python's slice syntax, but too clever by half otherwise. I've been coding Python since 2000 and can count o
by js2 3y ago
It's pretty clear if you're intimately familiar with Python's slice syntax, but too clever by half otherwise. I've been coding Python since 2000 and can count on one hand the number of times I've used the step parameter in a slice.
- robertlagrant 3y agoOh - no, I know that one (-: It's that the command ppp is also the output.
- js2 3y agoIt's pretty clear if you're intimately familiar with the Unix command line, but too clever by half otherwise. I've been using Unix since 1994 and can count on zero fingers the number of times I've needed to slice input through a pipe like this. :-) Also, just to make sure we're on the same page: The command `ppp` (found somewhere in PATH, unless it's a shell function or an alias, but we believe it's a symlink to `pypipe.py`) receives `pypipe\n` on stdin, sets a variable named `line` to `pypipe`, uses the slice notation to convert that to `ppp` and then prints `ppp\n` to stdout.
- jedberg 3y agoI think it's to show you were the name comes from. :)
- paddy_m 3y agoit gets worse. I have to look up numpy comma/tuple slicing syntax everytime I use it.
- DigiDigiorno 3y ago90% of the time I remember running into it, it was just used to reverse a copy of the list. (i.e. 'a = l[::-1]')