[Freeipa-devel] [PATCH] 142 Improve default user/group object class validation

Alexander Bokovoy abokovoy at redhat.com
Tue Oct 11 10:57:55 UTC 2011


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




More information about the Freeipa-devel mailing list