table, but that only has to be done once per
dispatch table/switch statement pair, and can then be stred in one or
the other (probably the dispatch table, as that will be a proper
object).
-- Eric Sumner
___
Python-Dev mailing list
Python-Dev@python.org
, and the switch statement provides a
mapping from labels/cases to code. Sorry about introducing a new term
without saying anything about it.
-- Eric Sumner
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
a value
given its name, a dispatch table is used to look up a name given its
value. The switch statement then lets you actually do something based
on which name is returned.
-- Eric Sumner
___
Python-Dev mailing list
Python-Dev@python.org
http
with making a dispatch table unless they are defining
enumeration values themselves.
-- Eric Sumner
Note: I sent an email yesterday with a proposal to this effect, but it
seems to have been lost. If anybody wants, I can resend it.
___
Python-Dev mailing
, not the dispatcher) matches, the switch's 'else' block is
executed, if present. If more than one case (from the switch)
matches, an exception is raised. Otherwise, the code from associated
case block is executed.
-- Eric Sumner
PS. Yes, I know that's not how pygame handles idle events; it makes a
better
the feasability or performance implications of
this proposal, but I think it basically covers the problem.
-- Eric Sumner
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http
(such as how long a
check of a single variable takes relative to binding a new value to a
name), I can't properly evaluate how much of a problem this would be.
-- Eric Sumner
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman
.
How does this interact with __contains__, __len__, and __iter__ for
the 'case in S' statement? Would it work with a class that only
implements __contains__, such as a continuous range class?
-- Eric Sumner
___
Python-Dev mailing list
Python-Dev
enumerated instead of simply tested against.
-- Eric Sumner
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
) faster, then it actually has a
purpose and use.
Again, I concur. My point was not that the mechanics of the construct
were incorrect, but that the proposed syntax misrepresented its
function. Again, I am sorry if I was unclear about this.
-- Eric Sumner
On 2/12/06, Josiah Carlson [EMAIL PROTECTED] wrote:
[paragraphs swapped]
The desire for context managers to have access to its enclosing scope is
another discussion entirely, though it may do so without express
permission via stack frame manipulation.
My main point was that, with relatively
On 2/13/06, Nick Coghlan [EMAIL PROTECTED] wrote:
Eric Sumner wrote:
I realize that I made an assumption that may not be valid;
namely, that a new scope is generated by the 'with' statement.
The with statement uses the existing scope - its just a way of factoring out
try/finally
of these
suggestions would be to implement, or if it would be a good idea to do
so. At this point, they are just something to think about
-- Eric Sumner
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
13 matches
Mail list logo