This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author r.david.murray
Recipients Massimiliano Culpo, docs@python, r.david.murray, skrah, steven.daprano
Date 2017-12-12.14:10:32
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1513087832.48.0.213398074469.issue32288@psf.upfronthosting.co.za>
In-reply-to
Content
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 :)
History
Date User Action Args
2017-12-12 14:10:32r.david.murraysetrecipients: + r.david.murray, steven.daprano, skrah, docs@python, Massimiliano Culpo
2017-12-12 14:10:32r.david.murraysetmessageid: <1513087832.48.0.213398074469.issue32288@psf.upfronthosting.co.za>
2017-12-12 14:10:32r.david.murraylinkissue32288 messages
2017-12-12 14:10:32r.david.murraycreate