Terry Reedy wrote:
> Jeff covered the obvious objection that this is a change from
assignment
> sematics to function call semantics.
> Slightly less obvious is that this
> will slow down everyone's for loops for the benefit of the very few
who
> would want to do such a thing.
If the action of (x,
On Mon, 21 Mar 2005 15:56:26 -0500, "George Sakkis"
<[EMAIL PROTECTED]> wrote:
>It has already been clarified twice in the thread that the default values
>would be allowed *only in
>the end*, exactly as default function arguments.
Was just asking if there should be other special general cases.
Jeff Shannon wrote:
Function arguments are *not* (in general) a case of tuple unpacking, on
the other hand, so the parallels between function arguments and for loop
control-variable tuples are not so straightforward as is being claimed.
It seems to me the parallel is close enough that no
confusio
"George Sakkis" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> A generalization of the 'for .. in' syntax that would handle
> extra arguments the same way as functions would be:
>
> for (x,y,z=0,*rest) in (1,2,3), (3,4), (5,6,7,8):
> print x, y, z, rest
>
> I'd love to see this
George Sakkis wrote:
A generalization of the 'for .. in' syntax that would handle
> extra arguments the same way as functions would be:
for (x,y,z=0,*rest) in (1,2,3), (3,4), (5,6,7,8):
print x, y, z, rest
I'd love to see this in python one day; it is pretty obvious what
> it would do for any
"Ron" <[EMAIL PROTECTED]> wrote:
> How would this examples work?
>
> for x=5,y,z in (123),(4,5),(6,7,8,9)
>
> Would the x default over ride the first value?
> Should, the 4 element in the third tuple be dropped without an error?
It has already been clarified twice in the thread that the default v
On Sun, 20 Mar 2005 13:16:37 -0500, "George Sakkis"
<[EMAIL PROTECTED]> wrote:
>I'm sure there must have been a past thread about this topic but I don't know
>how to find it: How
>about extending the "for in" syntax so that X can include default
>arguments ? This would be very
>useful for list/
George Sakkis wrote:
> > Looks very appealing, but what to do with
> >
> > [x*y-z for (x=0,y,z) in (1,2,3), (4,5), (6,7,8)] ?
> >
> > Should it raise an exception due to a pattern mismatch?
>
> I didn't have in mind to generalize the syntax even more than the
respective
> for function
> signatures
"Heiko Wundram" <[EMAIL PROTECTED]> wrote:
> Am Sonntag, 20. März 2005 22:22 schrieb George Sakkis:
> > Once more, the 2D/3D example was just that, an example; my point was not to
> > find a specific solution to a specific problem.
>
> And my point being: it's simple enough to give a general recip
Am Sonntag, 20. März 2005 22:22 schrieb George Sakkis:
> Once more, the 2D/3D example was just that, an example; my point was not to
> find a specific solution to a specific problem.
And my point being: it's simple enough to give a general recipe (which my
example was) without extending Python's
"Heiko Wundram" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
>
> On Sunday 20 March 2005 20:47, George Sakkis wrote:
> > Not always. Say for example that you're doing some 2D geometry stuff, and
> > later you have to extend it to 3D. In this case you may have to deal with
> > both 2D
On Sunday 20 March 2005 20:47, George Sakkis wrote:
> Not always. Say for example that you're doing some 2D geometry stuff, and
> later you have to extend it to 3D. In this case you may have to deal with
> both 2D and 3D objects, and map the former to the latter when necessary.
But this rather sou
"Matteo Dell'Amico" <[EMAIL PROTECTED]> wrote:
> George Sakkis wrote:
> > I'm sure there must have been a past thread about this topic but I don't
> > know how to find it:
How
> > about extending the "for in" syntax so that X can include default
> > arguments ? This would be
very
> > useful for
"Kay Schluehr" <[EMAIL PROTECTED]> wrote:
> George Sakkis wrote:
>
> > This would be very
> > useful for list/generator comprehensions, for example being able to
> write something like:
> >
> > [x*y-z for (x,y,z=0) in (1,2,3), (4,5), (6,7,8)]
> >
>
> Looks very appealing, but what to do with
>
> [
George Sakkis wrote:
I'm sure there must have been a past thread about this topic but I don't know
how to find it: How
about extending the "for in" syntax so that X can include default arguments
? This would be very
useful for list/generator comprehensions, for example being able to write
somet
George Sakkis wrote:
> This would be very
> useful for list/generator comprehensions, for example being able to
write something like:
>
> [x*y-z for (x,y,z=0) in (1,2,3), (4,5), (6,7,8)]
>
Looks very appealing, but what to do with
[x*y-z for (x=0,y,z) in (1,2,3), (4,5), (6,7,8)] ?
Should it rai
16 matches
Mail list logo