Collection Classes
collections.UserList()
Wrap a list for customized sequence subclasses. The data attribute is a real list initialized from the supplied iterable.
Formal Syntax & Structure
python syntaxpython
collections.UserList(initialdata=None)Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| initialdata | iterable or None | Initial elements. |
Return Value
UserList
The UserList result described above.
Working Example
Example Snippetpython
import collectionsu=collections.UserList([1,2])u.append(3)print(u.data)