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

[Python-Dev] Switch statement

[Python-Dev] Switch statement [Python-Dev] Switch statementGuido van Rossum guido at python.org
Wed Jun 21 22:21:18 CEST 2006
On 6/21/06, Fredrik Lundh <fredrik at pythonware.com> wrote:
> Fredrik Lundh wrote:
>
> >> But in most cases the 'constant' is actually an expression involving a
> >> global, often even a global in another module. (E.g. sre_compile.py)
> >> The compiler will have a hard time proving that this is really a
> >> constant, so it won't optimize the code.
> >
> > unless we come up with a way to make it possible to mark an variable as
> > a constant.
>
> such as the primary
>
>      'constant' expr
>
> which simply means that expr will be evaluated at function definition
> time, rather than at runtime.  example usage:
>
>      var = expression
>      if var == constant sre.FOO:
>          ...
>      elif var == constant sre.BAR:
>          ...
>      elif var in constant (sre.FIE, sre.FUM):
>          ...

This gets pretty repetitive. One might suggest that 'case' could imply
'constant'...?

-- 
--Guido van Rossum (home page: http://www.python.org/~guido/)
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