News for hackers. Stuff that matters.
Re:Why Do Python Lists Multiply Oddly? Exploring the CPython... by throwaway0665 on Tuesday April 09, 2024 @01:58AM (#39976523)
Sure there is a reason it is that way. But it doesn't mean it's not incredibly unintuitive and error-prone.
Re:Why Do Python Lists Multiply Oddly? Exploring the CPython... by Joker_vD on Tuesday April 09, 2024 @02:03AM (#39976548)
Yes, the reason is that it's a tradition to have it this way. Python IMHO has decent enough assignment semantics that using "default argument expressions" model would've been fine, unlike e.g. in C++.