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

2006-07-15 Thread Josiah Carlson
"Marcin 'Qrczak' Kowalczyk" <[EMAIL PROTECTED]> wrote: > > Greg Ewing <[EMAIL PROTECTED]> writes: > > > So I'd like to propose that "def time" be modified > > slightly to mean "def time of the outermost function > > that is still inside the scopes containing all the > > names that the case expre

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

2006-07-15 Thread Marcin 'Qrczak' Kowalczyk
Greg Ewing <[EMAIL PROTECTED]> writes: > So I'd like to propose that "def time" be modified > slightly to mean "def time of the outermost function > that is still inside the scopes containing all the > names that the case expressions depend on". Not > sure about the wording of that, but I hope you

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

2006-07-12 Thread Jim Jewett
On 7/7/06, Guido van Rossum <[EMAIL PROTECTED]> wrote: > I don't like storing it as a global; and that's probably incorrect > too, e.g. if multiple definitions of f are being made in a loop. Should the case expressions be different for each loop? If not, then it doesn't matter, and a per-module s

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

2006-07-09 Thread Guido van Rossum
On 7/9/06, Greg Ewing <[EMAIL PROTECTED]> wrote: > For an expert user, I don't think "outermost possible > function object" is substantially harder to grasp than > "immediately enclosing function object". I'm not getting through here. I think it is harder to debug because now you have to take into

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

2006-07-09 Thread Greg Ewing
Guido van Rossum wrote: > On 7/7/06, Greg Ewing <[EMAIL PROTECTED]> wrote: > >> You seem to be conflating "nested functions" and >> "functional programming", which doesn't make sense >> to me. > > Not even a smidgen? Small nested functions (or lambdas) are pretty > common in a functional style.

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

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

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] 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 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 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: > 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] Switch and static, redux

2006-07-06 Thread Guido van Rossum
On 7/6/06, Greg Ewing <[EMAIL PROTECTED]> wrote: > 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 fr

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

2006-07-06 Thread Michael Chermside
Greg Ewing writes: > Maybe a compromise could be reached by having the > style guide recommend a two-space indent for the > cases, and a further two-space indent for the > case bodies. Then the overall indentation of the > bodies would still be only four spaces. +1: I tried it and it looks good on

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

2006-07-05 Thread Greg Ewing
Georg Brandl wrote: > I'm not very comfortable about the no-additional-indentation-after-colon > syntax too, but I also realize that requiring two levels of indentation > for a single statement is too much. That's a matter of opinion. I don't have any trouble with it, but then I don't tend to set

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

2006-07-05 Thread Greg Ewing
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. -- Greg _

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

2006-07-05 Thread Greg Ewing
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) I agree with giving up on static, or at least treatin

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

2006-07-05 Thread Barry Warsaw
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Jul 5, 2006, at 6:54 AM, 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

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

2006-07-05 Thread Guido van Rossum
On 7/5/06, Andrew Clover <[EMAIL PROTECTED]> wrote: > Guido van Rossum <[EMAIL PROTECTED]> wrote: > > > (I'm not super confident about the syntax alternatives yet.) > > The switch:-without-indent business still naggingly makes me feel > uncomfortable. Me too, but only on even-numbered days... > I

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

2006-07-05 Thread Georg Brandl
Andrew Clover wrote: > Guido van Rossum <[EMAIL PROTECTED]> wrote: > >> (I'm not super confident about the syntax alternatives yet.) > > The switch:-without-indent business still naggingly makes me feel > uncomfortable. > > Is this a valid no-case-switch? > >switch cake: >print 'hello'

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

2006-07-05 Thread Andrew Clover
Guido van Rossum <[EMAIL PROTECTED]> wrote: > (I'm not super confident about the syntax alternatives yet.) The switch:-without-indent business still naggingly makes me feel uncomfortable. Is this a valid no-case-switch? switch cake: print 'hello' Here's another syntax off the top of my

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

2006-07-05 Thread Thomas Wouters
On 7/5/06, Guido van Rossum <[EMAIL PROTECTED]> wrote: One of her comments struck home: the open source development process,which is often represented as exclusively taking place on line, isactually augmented in a significant way by direct physical interactionbetween developers at events like EuroP

[Python-3000] Switch and static, redux

2006-07-05 Thread Guido van Rossum
I'm sitting here at EuroPython listening to a speaker who has analyzed interaction patterns on python-dev. (She represents me as a red dot and Raymond H as a yellow star in a diagram. I'm trying not to read too much into that. :-) One of her comments struck home: the open source development proces