Heiko Wundram wrote:
> Am Mittwoch 24 Mai 2006 06:12 schrieb Tim Roberts:
>> At one time, it was said that the "%" operator was the fastest way to
>> concatenate strings, because it was implemented in C, whereas the +
>> operator was interpreted. However, as I recall, the difference was
>> hardly
Am Mittwoch 24 Mai 2006 06:12 schrieb Tim Roberts:
> At one time, it was said that the "%" operator was the fastest way to
> concatenate strings, because it was implemented in C, whereas the +
> operator was interpreted. However, as I recall, the difference was hardly
> measurable, and may not eve
Edward Elliott <[EMAIL PROTECTED]> wrote:
>bruno at modulix wrote:
>
>> Edward Elliott wrote:
>>> You mean like this:
>>>
>>> s = "foo" + "bar"
>>> s = 'foo' + 'bar'
>>> s = 'foo' 'bar'
>>> s = '%s%s' % ('foo', 'bar')
>[snip]
>> The real mantra is actually :
>> "There should be one-- and preferab
+1 It does seem like a natural unificiation of the language -- one less
exception to learn.
-- Russell
--
http://mail.python.org/mailman/listinfo/python-list
bruno at modulix wrote:
> Edward Elliott wrote:
>> You mean like this:
>>
>> s = "foo" + "bar"
>> s = 'foo' + 'bar'
>> s = 'foo' 'bar'
>> s = '%s%s' % ('foo', 'bar')
[snip]
> The real mantra is actually :
> "There should be one-- and preferably only one --obvious way to do it"
>
> Please note th
Am Montag 22 Mai 2006 11:27 schrieb Boris Borcic:
> Mhhh, your unsugared form remind me of darks hours with primitive BASICS in
> my youth - the kind Dijsktra commented on. Why don't you write
>
> for node in tree:
> if node.haschildren():
>
As I've replied on
Heiko Wundram wrote:
...
> As I've noticed that I find myself typing the latter quite often
> in code I write, it would only be sensible to add the corresponding
> syntax for the for statement:
>
> for node in tree if node.haschildren():
>
>
> as syntactic sugar f
Edward Elliott wrote:
> George Sakkis wrote:
>
>
>>Em Dom, 2006-05-21 às 17:11 +0200, Heiko Wundram escreveu:
>>
>>>for node in tree if node.haschildren():
>>>
>>>
>>>as syntactic sugar for:
>>>
>>>for node in tree:
>>>if not node.haschildren():
>>>continue
>>>
>
> [snip]
>
>>2) "There should b
Edward Elliott wrote:
> Special cases aren't special enough to break the rules. (proposal eliminates
> the current special case for comprehensions/generators)
It really isn't a special case, though. It might seem like it is, but
it's not at all when you remember the rules of equivalence between
l
Heiko Wundram wrote:
> The following PEP tries to make the case for a slight unification of for
> statement and list comprehension syntax.
-1
Adds complexity to the language and saves you nothing but an indent
level. However, I encourage you to submit this PEP and get a (almost
certianly negativ
George Sakkis wrote:
> Em Dom, 2006-05-21 às 17:11 +0200, Heiko Wundram escreveu:
>> for node in tree if node.haschildren():
>>
>>
>> as syntactic sugar for:
>>
>> for node in tree:
>> if not node.haschildren():
>> continue
>>
[snip]
>
> 2) "There should be one and preferably only one way to d
Felipe Almeida Lessa wrote:
> Em Dom, 2006-05-21 às 11:52 -0700, gangesmaster escreveu:
> > > Today you can archive the same effect (but not necessarily with the same
> > > performance) with:
> > >
> > > for node in (x for x in tree if x.haschildren()):
> > >
> >
> > true, but it has differen
Em Dom, 2006-05-21 às 11:52 -0700, gangesmaster escreveu:
> > Today you can archive the same effect (but not necessarily with the same
> > performance) with:
> >
> > for node in (x for x in tree if x.haschildren()):
> >
>
> true, but it has different semantic meanings
>
I know, that's also
> Today you can archive the same effect (but not necessarily with the same
> performance) with:
>
> for node in (x for x in tree if x.haschildren()):
>
true, but it has different semantic meanings
-tomer
--
http://mail.python.org/mailman/listinfo/python-list
Em Dom, 2006-05-21 às 17:11 +0200, Heiko Wundram escreveu:
> for node in tree if node.haschildren():
>
>
> as syntactic sugar for:
>
> for node in tree:
> if not node.haschildren():
> continue
>
Today you can archive the same effect
On 2006-05-21, Heiko Wundram wrote:
> Hi all!
>
> The following PEP tries to make the case for a slight unification of for
> statement and list comprehension syntax.
Sounds great!
--
Konrad
--
http://mail.python.org/mailman/listinfo/python-list
i wanted to suggest this myself. +1
-tomer
--
http://mail.python.org/mailman/listinfo/python-list
Hi all!
The following PEP tries to make the case for a slight unification of for
statement and list comprehension syntax.
Comments appreciated, including on the sample implementation.
===
PEP: xxx
Title: Unification of for-statement and list-comprehension syntax
Version: $Revision$
Last-Modifie
18 matches
Mail list logo