On Fri, May 26, 2006, Fredrik Lundh wrote:
>
> and while we're at it, let's fix this:
>
> >>> 0.66 * (1, 2, 3)
> (1, 2)
>
> and maybe even this
>
> >>> 0.5 * (1, 2, 3)
> (1, 1)
>
> but I guess the latter one might need a pronunciation.
This should certainly get fixed in 3.0
On 5/26/06, Facundo Batista <[EMAIL PROTECTED]> wrote:
> I think that we can do one of the following, when we found "-1 * (1, 2, 3)":
>
> - Treat -1 as 0 and return an empty tuple (actual behavior).
> - Treat the negative as a reverser, so we get back (3, 2, 1).
> - Raise an error.
No, no, no. Th
2006/5/26, Steven Bethard <[EMAIL PROTECTED]>:
> On 5/26/06, Facundo Batista <[EMAIL PROTECTED]> wrote:
> > All this different ways enforce my vote: we should get an error...
> ...
> But if this change goes in, I want a big "we're breaking backwards
> incompatibility" message somewhere. I say
On 5/26/06, Facundo Batista <[EMAIL PROTECTED]> wrote:
> All this different ways enforce my vote: we should get an error...
Perhaps you missed Tim's post, so here's a few lines of my own code
that I know would break:
padding = [None] * (self.width - len(leaves))
left_padding = [None]
2006/5/26, Fred L. Drake, Jr. <[EMAIL PROTECTED]>:
> Even better:
>
> "123"*-1
>
> We'd get to explain:
>
> - what the "*-" operator is all about, and
>
> - why we'd use it with a string and an int.
>
> I see possibilities here. :-)
All this different ways enforce my vote: we should get
Fred L. Drake, Jr. wrote:
> Even better:
>
> "123"*-1
>
> We'd get to explain:
>
> - what the "*-" operator is all about, and
>
> - why we'd use it with a string and an int.
>
> I see possibilities here. :-)
the infamous "*-" clear operator? who snuck that one into python?
_
Fred> I see possibilities here. :-)
Fred appears to be looking for more job security. ;-)
Skip
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/option
Fredrik Lundh wrote:
> Sean Reifschneider wrote:
>
>>> - Treat the negative as a reverser, so we get back (3, 2, 1).
>>
>> Then we could get:
>>
>>>>> print -123
>>321
>>
>> Yay!
>
> and while we're at it, let's fix this:
>
> >>> 0.66 * (1, 2, 3)
> (1, 2)
>
> and maybe even
On Friday 26 May 2006 11:50, Georg Brandl wrote:
> This is actually a nice idea, because it's even a more nonintuitive
> answer for Python newbies posting to c.l.py asking how to reverse
> a string
Even better:
"123"*-1
We'd get to explain:
- what the "*-" operator is all about, and
-
Sean Reifschneider wrote:
>> - Treat the negative as a reverser, so we get back (3, 2, 1).
>
> Then we could get:
>
>>>> print -123
>321
>
> Yay!
and while we're at it, let's fix this:
>>> 0.66 * (1, 2, 3)
(1, 2)
and maybe even this
>>> 0.5 * (1, 2, 3)
(1, 1)
bu
Facundo Batista wrote:
> 2006/5/26, Sean Reifschneider <[EMAIL PROTECTED]>:
>
>> On Fri, May 26, 2006 at 12:37:02PM -0300, Facundo Batista wrote:
>> >- Treat the negative as a reverser, so we get back (3, 2, 1).
>>
>> Then we could get:
>>
>>>>> print -123
>>321
>
> An integer is NOT a se
2006/5/26, Sean Reifschneider <[EMAIL PROTECTED]>:
> On Fri, May 26, 2006 at 12:37:02PM -0300, Facundo Batista wrote:
> >- Treat the negative as a reverser, so we get back (3, 2, 1).
>
> Then we could get:
>
>>>> print -123
>321
An integer is NOT a sequence.
OTOH, that should be consiste
On Fri, May 26, 2006 at 12:37:02PM -0300, Facundo Batista wrote:
>- Treat the negative as a reverser, so we get back (3, 2, 1).
Then we could get:
>>> print -123
321
Yay!
Thanks,
Sean
--
Sometimes it pays to stay in bed on Monday, rather than spending the rest
of the week debugging Mon
2006/5/25, Fredrik Lundh <[EMAIL PROTECTED]>:
> >>> -1 * (1, 2, 3)
> ()
> >>> -(1, 2, 3)
> Traceback (most recent call last):
>File "", line 1, in
> TypeError: bad operand type for unary -
>
> We Really Need To Fix This!
I don't see here an inconsistency. The operator "*" is not a
multipli
Greg Ewing wrote:
> Steve Holden wrote:
>
>
>>In actual fact the effbot has lately found itself so permeated with
>>Windows that it has become constituionally incapable of using a forward
>>slash. Don't know what's with the square brackets though ...
>
>
> I was thinking maybe that message ha
Steve Holden wrote:
> In actual fact the effbot has lately found itself so permeated with
> Windows that it has become constituionally incapable of using a forward
> slash. Don't know what's with the square brackets though ...
I was thinking maybe that message had resulted from
a Windows and a
Georg Brandl wrote:
> Martin v. Löwis wrote:
>> Fredrik Lundh wrote:
>>> >>> -1 * (1, 2, 3)
>>> ()
>>> >>> -(1, 2, 3)
>>> Traceback (most recent call last):
>>>File "", line 1, in
>>> TypeError: bad operand type for unary -
>>>
>>> We Really Need To Fix This!
>>
>> I can't find this incons
Tim Peters wrote:
> [Raymond Hettinger]
> ...
>> Also, I'm not clear on the rationale for transforming negative
>> repetition counts to zero instead of raising an exception.
>
> There are natural use cases. Here's one: you have a string and want
> to right-justify it to 80 columns with blanks if
Fredrik Lundh wrote:
> Guido van Rossum wrote:
>
>
>>>We Really Need To Fix This!
>>>
>>>[\F]
>>
>>Doesn't the real effbot have /F as sig?
>
>
> yeah, we've had some trouble with fake bots lately. I mean, there's a
> timbot posting to this thread, but I know for sure that the real Tim got
>
Guido van Rossum wrote:
>> We Really Need To Fix This!
>>
>> [\F]
>
> Doesn't the real effbot have /F as sig?
yeah, we've had some trouble with fake bots lately. I mean, there's a
timbot posting to this thread, but I know for sure that the real Tim got
tired of hacking on Python earlier tonig
[Raymond Hettinger]
...
> Also, I'm not clear on the rationale for transforming negative
> repetition counts to zero instead of raising an exception.
There are natural use cases. Here's one: you have a string and want
to right-justify it to 80 columns with blanks if it's shorter than 80.
s
On 5/25/06, Raymond Hettinger <[EMAIL PROTECTED]> wrote:
> Fredrik Lundh wrote:
>
> > >>> -1 * (1, 2, 3)
> >()
> > >>> -(1, 2, 3)
> >Traceback (most recent call last):
> > File "", line 1, in
> >TypeError: bad operand type for unary -
> >
> >We Really Need To Fix This!
> >
> >
>
> The second one
[Fredrik]
> >>> -1 * (1, 2, 3)
> ()
> >>> -(1, 2, 3)
> Traceback (most recent call last):
>File "", line 1, in
> TypeError: bad operand type for unary -
>
> We Really Need To Fix This!
What's broken? It's generally true that
n*s == s*n == empty_container_of_type_type(s)
whenever s is
Fredrik Lundh wrote:
> >>> -1 * (1, 2, 3)
>()
> >>> -(1, 2, 3)
>Traceback (most recent call last):
> File "", line 1, in
>TypeError: bad operand type for unary -
>
>We Really Need To Fix This!
>
>
The second one doesn't bug me. Unary minus on a sequence is meaningless.
The first is a bit o
On Thu, May 25, 2006 at 09:06:49PM +, Georg Brandl wrote:
>Don't tell me that! I was actually working on a patch right now...
While undoubtedly a performance patch, it wasn't on the list of tasks to do
today. You risk Steve's wrath!
Thanks,
Sean
--
In the end, we will remember not the word
Ronald Oussoren wrote:
> I don't know which one Fredrik thinks is wrong, but I think the result
> of -1*(1,2,3) is very surprising. I'd expect an exception here.
I agree, but this has nothing to do with whether or not the unary -
is supported.
Regards,
Martin
_
On 25-mei-2006, at 23:04, Martin v. Löwis wrote:
> Fredrik Lundh wrote:
> -1 * (1, 2, 3)
>> ()
> -(1, 2, 3)
>> Traceback (most recent call last):
>>File "", line 1, in
>> TypeError: bad operand type for unary -
>>
>> We Really Need To Fix This!
>
> I can't find this inconsistency hor
You're joking right?
On 5/25/06, Fredrik Lundh <[EMAIL PROTECTED]> wrote:
> >>> -1 * (1, 2, 3)
> ()
> >>> -(1, 2, 3)
> Traceback (most recent call last):
>File "", line 1, in
> TypeError: bad operand type for unary -
>
> We Really Need To Fix This!
>
> [\F]
Doesn't the real effbot have /F
Martin v. Löwis wrote:
> Fredrik Lundh wrote:
>> >>> -1 * (1, 2, 3)
>> ()
>> >>> -(1, 2, 3)
>> Traceback (most recent call last):
>>File "", line 1, in
>> TypeError: bad operand type for unary -
>>
>> We Really Need To Fix This!
>
> I can't find this inconsistency horrible.
>
> py> +"Hell
Fredrik Lundh wrote:
> >>> -1 * (1, 2, 3)
> ()
> >>> -(1, 2, 3)
> Traceback (most recent call last):
>File "", line 1, in
> TypeError: bad operand type for unary -
>
> We Really Need To Fix This!
I can't find this inconsistency horrible.
py> +"Hello"
Traceback (most recent call last):
F
30 matches
Mail list logo