On Sun, Jan 3, 2010 at 11:51 PM, Gabriel Genellina
gagsl-...@yahoo.com.ar wrote:
This
py [1,2,3] + (4,5)
Traceback (most recent call last):
File stdin, line 1, in module
TypeError: can only concatenate list (not tuple) to list
Given that tuples are sometimes used as a poor man's object
On Mon, 04 Jan 2010 04:59:02 -0300, Gabriel Genellina wrote:
Is there any reason for this error? Apart from nobody cared to write
the code
Yes, because such implicit conversions would be a bad idea.
py [1,2,3] + (4,5)
What result are you expecting? A list or a tuple?
Traceback (most
En Mon, 04 Jan 2010 04:58:54 -0300, Chris Rebert c...@rebertia.com
escribió:
On Sun, Jan 3, 2010 at 11:51 PM, Gabriel Genellina
gagsl-...@yahoo.com.ar wrote:
py [1,2,3] + (4,5)
Traceback (most recent call last):
File stdin, line 1, in module
TypeError: can only concatenate list (not tuple)
Is there any reason for this error? Apart from nobody cared to write the
code
py [1,2,3] + (4,5)
Traceback (most recent call last):
File stdin, line 1, in module
TypeError: can only concatenate list (not tuple) to list
In-place addition += does work:
py a = [1,2,3]
py a += (4,5)
Is there any reason for this error? Apart from nobody cared to write the
code
py [1,2,3] + (4,5)
Traceback (most recent call last):
File stdin, line 1, in module
TypeError: can only concatenate list (not tuple) to list
In-place addition += does work:
py a = [1,2,3]
py a += (4,5)
En Mon, 04 Jan 2010 05:24:56 -0300, David Williams da...@bibliolabs.com
escribió:
py [1,2,3] + (4,5)
Traceback (most recent call last):
File stdin, line 1, in module
TypeError: can only concatenate list (not tuple) to list
In-place addition += does work:
py a = [1,2,3]
py a += (4,5)
py
En Mon, 04 Jan 2010 05:22:44 -0300, Steven D'Aprano
ste...@remove.this.cybersource.com.au escribió:
On Mon, 04 Jan 2010 04:59:02 -0300, Gabriel Genellina wrote:
Is there any reason for this error? Apart from nobody cared to write
the code
Yes, because such implicit conversions would be a
On Mon, 04 Jan 2010 06:27:48 -0300, Gabriel Genellina wrote:
En Mon, 04 Jan 2010 05:24:56 -0300, David Williams
da...@bibliolabs.com escribió:
py [1,2,3] + (4,5)
Traceback (most recent call last):
File stdin, line 1, in module
TypeError: can only concatenate list (not tuple) to list
Gabriel Genellina wrote:
En Mon, 04 Jan 2010 05:24:56 -0300, David Williams
da...@bibliolabs.com escribió:
py [1,2,3] + (4,5)
Traceback (most recent call last):
File stdin, line 1, in module
TypeError: can only concatenate list (not tuple) to list
In-place addition += does work:
py a =
Gabriel Genellina wrote:
En Mon, 04 Jan 2010 04:58:54 -0300, Chris Rebert c...@rebertia.com
escribió:
On Sun, Jan 3, 2010 at 11:51 PM, Gabriel Genellina
gagsl-...@yahoo.com.ar wrote:
py [1,2,3] + (4,5)
Traceback (most recent call last):
File stdin, line 1, in module
TypeError: can only
On Tue, 05 Jan 2010 00:52:56 +, r0g wrote:
I'd be strongly inclined to think the result would be the sequence on
the left with the data from the second sequence appended to it. What's
wrong with a little duck typing here eh?
That's not the existing behaviour. List concatenation doesn't
Steven D'Aprano wrote:
On Tue, 05 Jan 2010 00:52:56 +, r0g wrote:
I'd be strongly inclined to think the result would be the sequence on
the left with the data from the second sequence appended to it. What's
wrong with a little duck typing here eh?
OK, I hadn't read all the other
12 matches
Mail list logo