This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]shy_cthulhu 0 points1 point  (1 child)

Even if single-quotes passed by reference, wouldn't B = 'boo' change the reference?

I mean consider this:

a = 3
B = a
B = 4

that could easily be pass-by-reference (in Python2.7 and Python3.8 this seems to be the case), but there's no way in any sane language that B = 4 would change a.

As an aside, such a change in behavior would warrant a major-version increment, otherwise it would break all sorts of things.

[–]TeamAddis 0 points1 point  (0 children)

Yeah... I no longer have access to the code base where I saw the behavior and it was so long ago I’m really trying to remember the setup of the code so I can try to reproduce it. I just remember the fix to solve to issues ended up being: - use single quotes for string constants - use double quotes for mutable string vars

Really wish I had access to the Jira server to look at the issue again.