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/066297.html below:

[Python-Dev] Switch statement

[Python-Dev] Switch statement [Python-Dev] Switch statementGreg Ewing greg.ewing at canterbury.ac.nz
Wed Jun 21 02:01:50 CEST 2006
Phillip J. Eby wrote:

> Actually, one could consider "case" expressions to be computed at function 
> definition time, the way function defaults are.  That would solve the 
> problem of symbolic constants, or indeed any sort of expressions.

That's an excellent idea!

> It's just a question of which one is easier to explain. 

I think the function-definition-time one is easiest to
both explain and also to reason about when writing code,
since definition time is well-defined, whereas "the first
time it's executed" is somewhat fuzzy.

It's also a lot clearer how it interacts with closures,
which is another good point.

I recommend adding this option to the relevant PEP
(whichever it is).

--
Greg
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