News for hackers. Stuff that matters.
Re:What's New in Python 3.12 by ddejohn on Wednesday October 18, 2023 @06:39PM (#37935753)
I wouldn't call a function that mutates the input "safe navigation", personally :)
Re:What's New in Python 3.12 by o11c on Wednesday October 18, 2023 @08:26PM (#37936678)
Er, it doesn't? `.get()` (or `[]` in the original) doesn't change the object, and `obj =` only changes which object the local variable refers to?

This isn't like C++ with its intrusive `=`.

Re:What's New in Python 3.12 by ddejohn on Thursday October 19, 2023 @05:14PM (#37948813)
You're right. Python is pass by reference and it's the reference being changed, not the object. This is what happens when you read code on the internet after drinks.