seq = [1,2]
seq.extend((3,4))
OK, this feature is referenced in the Python Library reference here :
https://docs.python.org/3.2/library/stdtypes.html#typesseq-mutable
not thoroughly referenced but, anyway, referenced.
seq+= {5, 6} # the order of extending is not determined
On Thu, Jul 3, 2014 at 5:51 PM, candide c.cand...@laposte.net wrote:
Good and interesting observation. But I can't find out where this feature is
referenced in the Language/Library Reference. Because, as my first post
explains, augmented assignment performs the binary operation associated to
From that link:
An augmented assignment expression like x += 1 can be rewritten as x =
x + 1 to achieve a similar, but not exactly equal effect. In the
augmented version, x is only evaluated once. Also, when possible, the
actual operation is performed in-place, meaning that
On 03/07/2014 10:35, candide wrote:
From that link:
An augmented assignment expression like x += 1 can be rewritten as x =
x + 1 to achieve a similar, but not exactly equal effect. In the
augmented version, x is only evaluated once. Also, when possible, the
actual operation is
An hybrid list-tuple concatenation is not allowed
[]+(1, 2)
Traceback (most recent call last):
File stdin, line 1, in module
TypeError: can only
On 7/2/2014 10:39 PM, candide wrote:
An hybrid list-tuple concatenation is not allowed
[]+(1, 2)
Traceback (most recent call last):
File stdin, line 1, in module
TypeError: can only concatenate list (not tuple) to list
hence I was expecting (*) that the following code raises a