Page MenuHome

Fix T58975: "@=" operator succeeds but has no effect
Needs ReviewPublic

Authored by Tom Edwards (artfunkel) on Dec 15 2018, 7:51 PM.



The method isn't copying enough bytes back to the original Matrix.


Diff Detail

rB Blender

Event Timeline

Tom Edwards (artfunkel) added a comment.EditedDec 16 2018, 12:21 AM

Although this patch fixes the issue I reported, the operator's behaviour is still different from @.

@= will modify the memory of the original Matrix object while @ will create a new one, which makes a difference when the Matrix being operating on was passed in from somewhere else. Changes made with @= will propagate outside the current scope, while changes made with @ are local.

Is this intended? This is not how the *= operator worked in 2.79.

@Tom Edwards (artfunkel) this is intended, it works this way for lists too.

>>> a = [5]
>>> b = a
>>> a *= 10
>>> b
[5, 5, 5, 5, 5, 5, 5, 5, 5, 5]

Makes sense. It's a breaking change though, could you add a note about it to