Re: [Python-3000] Switch and static, redux

2006-07-07 Thread Talin
Greg Ewing wrote: > Andrew Clover wrote: > > >>Here's another syntax off the top of my head - put the first case in the >>switch statement? >> >> switch biscuit.type if 'digestive': >> ... >> elif in 'jammy_dodger', 'garibaldi': >> ... >> else: >> ... > > > Ugly. s

Re: [Python-3000] Type Coersion Syntax

2006-07-07 Thread Thomas Wouters
On 7/6/06, Brett Cannon <[EMAIL PROTECTED]> wrote:  Plus, what is wrong with passing on object to a type/class' constructor: ``str(42)``?  Not redundant and it's still clean, obvious, and does not require new syntax. And you can already have multiple 'constructor-from-data' methods that way, like d

Re: [Python-3000] Switch and static, redux

2006-07-07 Thread Greg Ewing
Guido van Rossum wrote: > The > combination of the first and second suggests a functional programming > mindset which somehow makes the third less likely. You seem to be conflating "nested functions" and "functional programming", which doesn't make sense to me. > Your suggestion also makes it ha

Re: [Python-3000] Switch and static, redux

2006-07-07 Thread Talin
Greg Ewing wrote: > Guido van Rossum wrote: > >>The >>combination of the first and second suggests a functional programming >>mindset which somehow makes the third less likely. > > You seem to be conflating "nested functions" and > "functional programming", which doesn't make sense > to me. > >>

Re: [Python-3000] Switch and static, redux

2006-07-07 Thread Georg Brandl
Ka-Ping Yee wrote: > On Wed, 5 Jul 2006, Guido van Rossum wrote: >> So, my proposal is to give up on static, accept PEP 3103 with the >> following options: >> - Syntax alternative 2+B (unindented cases, 'case in ...' for >> multiple cases). >> - Semantics option 3 (def-time freezing) >> >>

Re: [Python-3000] Switch and static, redux

2006-07-07 Thread Ka-Ping Yee
On Wed, 5 Jul 2006, Guido van Rossum wrote: > So, my proposal is to give up on static, accept PEP 3103 with the > following options: > - Syntax alternative 2+B (unindented cases, 'case in ...' for > multiple cases). > - Semantics option 3 (def-time freezing) > > Do we need any more discussi

Re: [Python-3000] Suggestion to replace `global' keyword with `modular' ...

2006-07-07 Thread Greg Ewing
[EMAIL PROTECTED] wrote: > (If you look up "modular" at dictionary.com you will > see the first definition is exactly what we are trying to say.. > 'Of, relating to, or based on a module...") I'd say that dictionary is wrong. I've only ever seen "modular" used to mean "organised in the form of mo

Re: [Python-3000] gettype

2006-07-07 Thread Guido van Rossum
Hm... I'd rather not break my head over this right now. I've got a feeling that we have bigger fish to fry, and I'd like to focus on important things first. I'm also not convinced this is all that broken. --Guido On 7/6/06, tomer filiba <[EMAIL PROTECTED]> wrote: > as you may remember, i suggest

Re: [Python-3000] Switch and static, redux

2006-07-07 Thread Guido van Rossum
On 7/7/06, Georg Brandl <[EMAIL PROTECTED]> wrote: > Ka-Ping Yee wrote: > > On Wed, 5 Jul 2006, Guido van Rossum wrote: > >> So, my proposal is to give up on static, accept PEP 3103 with the > >> following options: > >> - Syntax alternative 2+B (unindented cases, 'case in ...' for > >> multip

[Python-3000] set literals

2006-07-07 Thread tomer filiba
i had this idea -- since quoted literals can be prefixed by a letter that alters their meaning, why not use the same semantics with curly braces? "hello" -- byte string literal r"hello" -- unescaped byte string literal u"hello" -- unicode string literal {1:2, 3:4, 5:6} -- dict literal s{1, 2, 3}

Re: [Python-3000] set literals

2006-07-07 Thread Diogo Kollross
> i had this idea -- since quoted literals can be prefixed by a letter > that alters their meaning, why not use the same semantics > with curly braces? String literals are always strings, no matter what kind of string as defined by the prefix. On the other hand, dictionaries and sets seems differe

Re: [Python-3000] set literals

2006-07-07 Thread tomer filiba
str and unicode are *distinct* types. they may be related, but not in the sense that type("hello") and type(r"hello") both return str. moreover, you can say a set is a "kind of" a keys-only dict. in fact, the first implementation of set used a dict, where the keys where the elements of the set, an

Re: [Python-3000] set literals

2006-07-07 Thread Guido van Rossum
-1. On 7/7/06, tomer filiba <[EMAIL PROTECTED]> wrote: > i had this idea -- since quoted literals can be prefixed by a letter > that alters their meaning, why not use the same semantics > with curly braces? > > "hello" -- byte string literal > r"hello" -- unescaped byte string literal > u"hello" -

Re: [Python-3000] Switch and static, redux

2006-07-07 Thread Guido van Rossum
On 7/7/06, Greg Ewing <[EMAIL PROTECTED]> wrote: > Guido van Rossum wrote: > > > The > > combination of the first and second suggests a functional programming > > mindset which somehow makes the third less likely. > > You seem to be conflating "nested functions" and > "functional programming", whic

Re: [Python-3000] Switch and static, redux

2006-07-07 Thread Guido van Rossum
On 7/7/06, Talin <[EMAIL PROTECTED]> wrote: > I'm in agreement with Greg here - his version sounds easier to > understand, with less hidden gotchas. I would rather have "it always > works with the same semantics, but some cases are slower than others", > than "it only works in some cases". I think