News for hackers. Stuff that matters.
Re:Reasons Python Sucks by Barrin92 on Saturday January 14, 2023 @07:38PM (#34385578)
any language with immutability by default, say Clojure.
Re:Reasons Python Sucks by ErikCorry on Saturday January 14, 2023 @07:48PM (#34385632)
If the object is immutable you can't really tell if it was passed by value or by reference. It becomes an implementation detail.
Re:Reasons Python Sucks by eyelidlessness on Saturday January 14, 2023 @08:16PM (#34385793)
Yep, one of the theoretical promises of FP that’s totally vindicated (unless there’s a language bug, but they usually get this much right). And because you can’t tell, you don’t need to care.

For folks working in imperative languages, you can achieve this same bliss by either not modifying your function parameters in the first place (hopefully this is obvious if you care about the distinction and find the language behavior ambiguous)… or by just doing whatever copy/clone/value transfer would be appropriate as a first step if you have good reason to modify the value of a parameter to your otherwise pure function.