[issue33636] Unexpected behavior with * and arrays

2018-05-24 Thread Steven D'Aprano
Steven D'Aprano added the comment: Nathan, the bug tracker is not the place to debate Python behaviour. For the purposes of the bug tracker, all we need say is that it is documented behaviour and not a bug. If you want to change that behaviour, there is a process

[issue33636] Unexpected behavior with * and arrays

2018-05-24 Thread R. David Murray
R. David Murray added the comment: I wrote up a response before Mark closed the issue, so despite his excellent no discussion suggestion I'm going to post it for the edification of anyone reading the issue later rather than waste the work :) Nathan: this is *long*

[issue33636] Unexpected behavior with * and arrays

2018-05-24 Thread Mark Dickinson
Mark Dickinson added the comment: @nanthil: If you want to discuss the reasons behind this design decision further, I'd suggest asking on one of the mailing lists, e.g. https://mail.python.org/mailman/listinfo/python-list This is not the right forum for this discussion.

[issue33636] Unexpected behavior with * and arrays

2018-05-24 Thread nathan rogers
nathan rogers added the comment: [[], [], [], [], []] How is it expected behavior in python, that when I update position 0, it decides to update positions 1-infinity as well? That is nonsense, and there is not a use case for this behavior. If you have already

[issue33636] Unexpected behavior with * and arrays

2018-05-24 Thread nathan rogers
nathan rogers added the comment: Can anyone give me a legitimate answer as to why this would be expected behavior? When at any point would you ever need that? If the list is local, you already have the thing. If it isn't local, you can pass it to a function by

[issue33636] Unexpected behavior with * and arrays

2018-05-24 Thread Steven D'Aprano
Steven D'Aprano added the comment: This is not a bug, it is the documented behaviour: the * operator does not copy the lists, it duplicates references to the same list. There's even a FAQ for it:

[issue33636] Unexpected behavior with * and arrays

2018-05-24 Thread nathan rogers
New submission from nathan rogers : https://repl.it/repls/ColorfulFlusteredPercent Here you can see the unexpected behavior I was speaking of. This behavior is NOT useful compared to the expected behavior. If I reference position 0 in the array, I expect position 0