Message308131
It actually makes sense that a slice assignment with a different length replacement list with a step of 1 works but any other step doesn't. Logically you can see that you can cut out a chunk and replace it with a different sized chunk, but you can't do that if the step is not abs(1). So a doc tweak may be appropriate. And it is surprising that -1 doesn't work (but why would you ever use it? :), so that might be a buglet.
For a numpy array, I imagine the rules are different, so an error there on stride 1 is not that surprising either, though *perhaps* there is room for improvement on the numpy side. (In other words, the stride 1 python behavior is "correct" from a python language perspective.)
And yes, it would be much easier to discuss these separate issues in separate issues. Now you know for next time :) |
|
Date |
User |
Action |
Args |
2017-12-12 14:10:32 | r.david.murray | set | recipients:
+ r.david.murray, steven.daprano, skrah, docs@python, Massimiliano Culpo |
2017-12-12 14:10:32 | r.david.murray | set | messageid: <1513087832.48.0.213398074469.issue32288@psf.upfronthosting.co.za> |
2017-12-12 14:10:32 | r.david.murray | link | issue32288 messages |
2017-12-12 14:10:32 | r.david.murray | create | |
|