[Python-ideas] Re: Python array multiplication for negative values should throw an error

2022-05-31 Thread fjwillemsen--- via Python-ideas
Thank you, that is a good point! I would expect a similar error message for multiplication with negative integers. A real-world example could be the scenario where I encountered this: arrays were consistently assumed to be NumPy arrays, but in some cases cached versions of these arrays would be

[Python-ideas] Re: Python array multiplication for negative values should throw an error

2022-05-31 Thread fjwillemsen--- via Python-ideas
Thanks for your response. While legacy production code is always an issue with potentially breaking changes, this line of thought would mean that future versions of Python could never introduce breaking changes. This should not be the case and is not the case now: for new Python versions, develo

[Python-ideas] Python array multiplication for negative values should throw an error

2022-05-31 Thread fjwillemsen--- via Python-ideas
Hopefully this is not a duplicate of an existing thread or in the wrong section, first time posting here. In Python, array multiplication is quite useful to repeat an existing array, e.g. [1,2,3] * 2 becomes [1,2,3,4,5,6]. Multiplication by 0 yields an empty array: [1,2,3] * 0 becomes []. Howe