IsString

Donn Cave donn at drizzle.com
Fri Dec 16 01:49:43 EST 2005


Quoth Chris Mellon <arkanes at gmail.com>:
| <snip a bunch of stuff>
|> Terminology is important, because we understand the world through
|> language. If your language is confused or misleading, your understanding
|> will also be confused or incomplete.
|
| I think the issue is pretty simple, myself:
|
| With mutable objects, Python has the semantics normally associated
| with pass-by-reference.
|
| With immutable objects, Python has the semantics normally associated
| with pass-by-value.

That's simple?  Where most of us understand it to work in one consistent
way, you need two ways?

Look, whatever you call the passing mechanism, there is _no_ difference
that depends on whether the object is mutable.  We can leave the definition
of mutable up to you, because it doesn't make any difference in this case
what it is.  Whatever properties an object may have when passed, the same
object arrives as a parameter with its properties unchanged, so obviously
the same semantics obtain.

Moreover, thinking about anything in terms of mutability is worse than a
waste of time, outside of a few odd cases like dictionary keys.

	Donn Cave, donn at drizzle.com



More information about the Python-list mailing list