Re: [Python-Dev] PEP 3103: A Switch/Case Statement

2006-06-29 Thread Eric Sumner
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

Re: [Python-Dev] PEP 3103: A Switch/Case Statement

2006-06-29 Thread Eric Sumner
, 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

Re: [Python-Dev] PEP 3103: A Switch/Case Statement

2006-06-29 Thread Eric Sumner
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

Re: [Python-Dev] PEP 3103: A Switch/Case Statement

2006-06-28 Thread Eric Sumner
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

[Python-Dev] Split switch statement

2006-06-27 Thread Eric Sumner
, 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

[Python-Dev] Temporary Constantification

2006-06-25 Thread Eric Sumner
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

Re: [Python-Dev] Temporary Constantification

2006-06-25 Thread Eric Sumner
(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

Re: [Python-Dev] Switch statement

2006-06-23 Thread Eric Sumner
. 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

Re: [Python-Dev] Switch statement

2006-06-23 Thread Eric Sumner
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

Re: [Python-Dev] Switch statement

2006-06-23 Thread Eric Sumner
) 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

Re: [Python-Dev] PEP 343: Context managers a superset of decorators?

2006-02-13 Thread 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

Re: [Python-Dev] PEP 343: Context managers a superset of decorators?

2006-02-13 Thread Eric Sumner
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

[Python-Dev] PEP 343: Context managers a superset of decorators?

2006-02-12 Thread Eric Sumner
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