2
0
mirror of https://github.com/boostorg/python.git synced 2026-01-28 19:32:14 +00:00

fixed iteration scheme and added append and extend methods

[SVN r19469]
This commit is contained in:
Joel de Guzman
2003-08-06 08:06:09 +00:00
parent 7754a91929
commit 9eb704f85a
4 changed files with 112 additions and 8 deletions

View File

@@ -300,6 +300,31 @@ e
>>> 12345 in v
0
#####################################################################
# Show that iteration allows mutable access to the elements
#####################################################################
>>> v[:] = ['a','b','c','d','e'] # reset again
>>> for x in v:
... x.reset()
>>> print_xvec(v)
[ reset reset reset reset reset ]
#####################################################################
# append
#####################################################################
>>> v[:] = ['a','b','c','d','e'] # reset again
>>> v.append('f')
>>> print_xvec(v)
[ a b c d e f ]
#####################################################################
# extend
#####################################################################
>>> v[:] = ['a','b','c','d','e'] # reset again
>>> v.extend(['f','g','h','i','j'])
>>> print_xvec(v)
[ a b c d e f g h i j ]
#####################################################################
# END....
#####################################################################