Closed chrisb-fico closed 1 year ago
Related: [1] * 4
does not produce [1, 1, 1, 1]
as expected
Are these not working even with operator overloads enabled using the opov
pragma?
Thanks! This fixes all cases except for [*a, *b]
, which still produces [['a', 'b'], ['c', 'd']]
.
IMO this feature should be made more prominent in the docs, given that it silently produces incorrect behaviour. Even more helpful would be to emit a warning when it is obvious that non-numeric objects are being added (in my case it I was adding list literals, which should be easy to detect).
Of these three functions which concatenate two lists, only the third one works properly:
The first returns a string,
'a,bc,d'
, and the second returns a list containing two nested lists,[ [ 'a', 'b' ], [ 'c', 'd' ] ]
I have tested this in the latest PyPI version, 3.9.0, which is also the latest Git master revision at the time of writing this.