A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2006-June/066541.html below:

[Python-Dev] Simple Switch statementZ

[Python-Dev] Simple Switch statementZ [Python-Dev] Simple Switch statementZKa-Ping Yee python-dev at zesty.ca
Mon Jun 26 02:43:27 CEST 2006
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
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4