Re:Why does a = a[0] = [0] create a self-referential list in...
by heavyset_go on Thursday November 18, 2021 @08:20PM
(#29272718)
Some languages wear the things that make you go WTF on their sleeves. In contrast, Python's surprises pop up slowly over time, and in places where you'd least expect them.
[ Parent
| on HN ]
Re:Why does a = a[0] = [0] create a self-referential list in...
by SOLAR_FIELDS on Friday November 19, 2021 @12:22AM
(#29274097)
I wonder if it’s because of their subtlety. I assume you are referencing JavaScript, where the warts are impossible to ignore because you can’t write an everyday program as a beginner without running into them. This sort of thing from the article is just not something I would typically be trying to do in the normal course of shuffling data around.