On Tue, 11 Oct 2011, Martin Kosek wrote:
> This was done on purpose. When you combine 2 lists in Python using +
> operator, a new list is created without modifying the old one. Check the
> following example:
> 
> >>> a = [1,2,3]
> >>> b = [4]
> >>> c = a+b
> >>> print c
> [1, 2, 3, 4]
> >>> print a
> [1, 2, 3]
> >>> print b
> [4]
> >>> c.append(5)
> >>> print c
> [1, 2, 3, 4, 5]
> >>> print a
> [1, 2, 3]
> >>> print b
> [4]
Sorry, but this is not our case:
>>> a = [1,2,3]
>>> b = a
>>> b += [4]
>>> print a
[1, 2, 3, 4]
>>> print b
[1, 2, 3, 4]

-- 
/ Alexander Bokovoy

_______________________________________________
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel

Reply via email to