Skip to content

Comment on Is Python call-by-value or call-by-reference? Neither.parent

Comments

The definition of call-by-value works fine for Python if you accept that object references are values in their own right, and that object variables contain those reference values.

If you don't accept that, then lots of other things become difficult to understand and explain as well. For instance, what do you call the thing that gets stored in a list? It's clearly not the object value itself, because that would preclude two lists from containing the same object.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.