-
Notifications
You must be signed in to change notification settings - Fork 277
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reinstating old behaviour of += with lists #1218
Conversation
Oh no. 🤦 |
I think that if you want to use Also, Basically, this bolis down to what is more commonly used: extend or append. One should keep the |
Ok, well what I did was make it so if you do |
So += appends except when the right hand side is a an iterable of any size, in which case it extends (or concatenates)? If that's the case, I recommend an extensive explanation in the docs, both in |
But you see Firi, I'm reinstating old behaviour which was accidentally removed earlier on, and no one noticed that it broke stuff. |
I know, but I don't like it, and I assume gnemon changed it on purpose :P Still, if you are making a PR reisntating the old behaviour, you can use the opportunity to clarify the thing to new user with a good documentation, because the behaviour is anything but trivial. |
I made a discord thread to discuss it: https://discord.com/channels/882822986795716608/882831843165085758/921494453682864129 |
Yeah - current behaviour is less confusing then proposed. 'put' has clear usecases for 'insert' and 'extend'. Plus that would break a few examples that are currently in the docs and work because += assume the value to add is always a scalar. |
Properly fixes #1152, as opposed to the hack-fix in #1154 which just works around it.
In ye olden days, when the += operator simply called
Value.add()
, this is the behaviour that would occur, i.e.: doingl=[]; l+=['3','4']
, would result inl==['3','4']
, whereas now it results inl==[['3','4']]
. This brokeshapes.scl
accidentally. I have also fixed this behaviour for maps, cos it's also broken there.