Re: [Python-Dev] problem with genexp

2005-10-20 Thread Neal Norwitz
On 10/16/05, Neal Norwitz <[EMAIL PROTECTED]> wrote: > On 10/10/05, Neal Norwitz <[EMAIL PROTECTED]> wrote: > > There's a problem with genexp's that I think really needs to get > > fixed. See http://python.org/sf/1167751 the details are below. This > > code: > > > > >>> foo(a = i for i in range(1

Re: [Python-Dev] Pre-PEP: Task-local variables

2005-10-20 Thread Phillip J. Eby
At 07:57 PM 10/20/2005 -0700, Guido van Rossum wrote: >(Sorry for the long post -- there just wasn't anything you said that I >felt could be left unquoted. :-) Wow. You've brought up an awful lot of stuff I want to respond to, about the nature of frameworks, AOP, Chandler, PEP 342, software depl

[Python-Dev] Questionable AST wibbles

2005-10-20 Thread Neal Norwitz
Jeremy, There are a bunch of mods from the AST branch that got integrated into head. Hopefully, by doing this on python-dev more people will get involved. I'll describe high level things first, but there will be a ton of details later on. If people don't want to see this crap on python-dev, I

Re: [Python-Dev] Coroutines, generators, function calling

2005-10-20 Thread Andrew Koenig
> so the new syntax would > not be useful, unless it was something that provided access to the index > item as a variable, like: > > yield foo(i) for i in x > > which barely saves you anything (a colon, a newline, and an indent). Not even that, because you can omit the newline and indent:

Re: [Python-Dev] AST branch is in?

2005-10-20 Thread Guido van Rossum
On 10/20/05, Anthony Baxter <[EMAIL PROTECTED]> wrote: > So it looks like the AST branch has landed. Wooo! Well done to all who > were involved - it seems like it's been a huge amount of work. Hear, hear. Great news! Thanks to Jeremy, Neil and all the others. I can't wait to check it out! -- --Gu

Re: [Python-Dev] Pre-PEP: Task-local variables

2005-10-20 Thread Guido van Rossum
On 10/20/05, Phillip J. Eby <[EMAIL PROTECTED]> wrote: > At 08:57 AM 10/20/2005 -0700, Guido van Rossum wrote: > >Whoa, folks! Can I ask the gentlemen to curb their enthusiasm? > > > >PEP 343 is still (back) on the drawing table, PEP 342 has barely been > >implemented (did it survive the AST-branch

[Python-Dev] A solution to the evils of static typing and interfaces?

2005-10-20 Thread Simon Belak
Hi, I was thinking why not have a separate file for all the proposed optional meta-information (in particular interfaces, static types)? Something along the lines of IDLs in CORBA (with pythonic syntax, of curse). This way most of the benefits are retained without "contaminating" the actual sy

Re: [Python-Dev] AST branch is in?

2005-10-20 Thread Neal Norwitz
On 10/20/05, Anthony Baxter <[EMAIL PROTECTED]> wrote: > > Could someone involved give a short email laying out what concrete (no > pun intended) advantages this new compiler gives us? Does it just > allow us to do new and interesting manipulations of the code during > compilation? Cleaner, easier

[Python-Dev] AST branch is in?

2005-10-20 Thread Anthony Baxter
So it looks like the AST branch has landed. Wooo! Well done to all who were involved - it seems like it's been a huge amount of work. Could someone involved give a short email laying out what concrete (no pun intended) advantages this new compiler gives us? Does it just allow us to do new and

Re: [Python-Dev] Pre-PEP: Task-local variables

2005-10-20 Thread Guido van Rossum
On 10/20/05, Phillip J. Eby <[EMAIL PROTECTED]> wrote: > At 04:04 PM 10/20/2005 -0400, Jeremy Hylton wrote: > >On 10/20/05, Guido van Rossum <[EMAIL PROTECTED]> wrote: > > > Whoa, folks! Can I ask the gentlemen to curb their enthusiasm? > > > > > > PEP 343 is still (back) on the drawing table, PEP

Re: [Python-Dev] bool(iter([])) changed between 2.3 and 2.4

2005-10-20 Thread Christos Georgiou
"Guido van Rossum" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] >> [Fred] >> > think iterators shouldn't have length at all: >> > they're *not* containers and shouldn't act that way. >> >> Some iterators can usefully report their length with the invariant: >>len(it) == len(list

Re: [Python-Dev] Pre-PEP: Task-local variables

2005-10-20 Thread Phillip J. Eby
At 08:57 AM 10/20/2005 -0700, Guido van Rossum wrote: >Whoa, folks! Can I ask the gentlemen to curb their enthusiasm? > >PEP 343 is still (back) on the drawing table, PEP 342 has barely been >implemented (did it survive the AST-branch merge?), and already you >are talking about adding more stuff. P

Re: [Python-Dev] list splicing

2005-10-20 Thread Christos Georgiou
"Greg Ewing" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Karl Chen wrote: >> Hi, has anybody considered adding something like this: >> a = [1, 2] >> [ 'x', *a, 'y'] >> >> as syntactic sugar for >> a = [1, 2] >> [ 'x' ] + a + [ 'y' ]. > > You can write that as >

Re: [Python-Dev] Pre-PEP: Task-local variables

2005-10-20 Thread Phillip J. Eby
At 04:04 PM 10/20/2005 -0400, Jeremy Hylton wrote: >On 10/20/05, Guido van Rossum <[EMAIL PROTECTED]> wrote: > > Whoa, folks! Can I ask the gentlemen to curb their enthusiasm? > > > > PEP 343 is still (back) on the drawing table, PEP 342 has barely been > > implemented (did it survive the AST-branc

Re: [Python-Dev] Pre-PEP: Task-local variables

2005-10-20 Thread Jeremy Hylton
On 10/20/05, Guido van Rossum <[EMAIL PROTECTED]> wrote: > Whoa, folks! Can I ask the gentlemen to curb their enthusiasm? > > PEP 343 is still (back) on the drawing table, PEP 342 has barely been > implemented (did it survive the AST-branch merge?), and already you > are talking about adding more s

Re: [Python-Dev] Pre-PEP: Task-local variables

2005-10-20 Thread Phillip J. Eby
At 10:40 PM 10/20/2005 +1000, Nick Coghlan wrote: >Phillip J. Eby wrote: > > This is still rather rough, but I figured it's easier to let everybody > fill > > in the remaining gaps by arguments than it is for me to pick a position I > > like and try to convince everybody else that it's right. :)

Re: [Python-Dev] enumerate with a start index

2005-10-20 Thread Lisandro Dalcin
On 10/19/05, Martin Blais <[EMAIL PROTECTED]> wrote: > Just wondering, would anyone think of it as a good idea if the > enumerate() builtin could accept a "start" argument? And why not an additional "step" argument? Anyway, perhaps all this can be done with a 'xrange' object... -- Lisandro DalcĂ­

Re: [Python-Dev] Early PEP draft (For Python 3000?)

2005-10-20 Thread Josiah Carlson
Jim Jewett <[EMAIL PROTECTED]> wrote: > I'll try to be more explicit; if Josiah and I are talking past each > other, than the explanation was clearly not yet mature. > > (In http://mail.python.org/pipermail/python-dev/2005-October/057251.html) > Eyal Lotem suggested: > > > Name: Attribute access

Re: [Python-Dev] Pre-PEP: Task-local variables

2005-10-20 Thread Guido van Rossum
Whoa, folks! Can I ask the gentlemen to curb their enthusiasm? PEP 343 is still (back) on the drawing table, PEP 342 has barely been implemented (did it survive the AST-branch merge?), and already you are talking about adding more stuff. Please put on the brakes! If there's anything this discussi

[Python-Dev] Early PEP draft (For Python 3000?)

2005-10-20 Thread Jim Jewett
I'll try to be more explicit; if Josiah and I are talking past each other, than the explanation was clearly not yet mature. (In http://mail.python.org/pipermail/python-dev/2005-October/057251.html) Eyal Lotem suggested: > Name: Attribute access for all namespaces ... > global x ; x = 1 > R

Re: [Python-Dev] Pre-PEP: Task-local variables

2005-10-20 Thread Nick Coghlan
Nick Coghlan wrote: > P.S. Here's a different generator wrapper that could be used to create a > generator-based "suspendable context" that can be invoked multiple times > through use of the "without" keyword. If applied to the PEP 343 > decimal.Context() __with__ method example, it would automa

Re: [Python-Dev] Pre-PEP: Task-local variables

2005-10-20 Thread Nick Coghlan
Phillip J. Eby wrote: > This is still rather rough, but I figured it's easier to let everybody fill > in the remaining gaps by arguments than it is for me to pick a position I > like and try to convince everybody else that it's right. :) Your feedback > is requested and welcome. I think you'r

Re: [Python-Dev] Definining properties - a use case for class decorators?

2005-10-20 Thread Michele Simionato
As other explained, the syntax would not work for functions (and it is not intended to). A possible use case I had in mind is to define inlined modules to be used as bunches of attributes. For instance, I could define a module as module m(): a = 1 b = 2 where 'module' would be the followi