On Sun, 25 Jun 2006, Guido van Rossum wrote:
> What do you think of Nick C's 'once'?
It's a bit closer to the right meaning... but what about:
def f(x):
def g(y):
return y + once x
return g
Does "once" mean not really once here, but "once for each new function
object that's created for g"?
> Right. But there are all sorts of objects that are compared by object
> identity (e.g. classes, modules, even functions) which may contain
> mutable components but are nevertheless "constant" for the purpose of
> switch or optimization. Let's not confuse this concept of constness
> with immutability.
That's a good point. We need a concept like "stable for equality"
separate from "constant", since "constant" and "immutable" will mislead
those who are used to the meanings of these words in other languages.
-- ?!ng
_______________________________________________
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com