< BACKMake Note | BookmarkCONTINUE >
156135250194107072078175030179198180024228156016206217188240240204175200043196103185095010

Related Modules

Table6.11 lists the key related modules for sequence types. This list includes the array module to which we briefly alluded earlier. These are similar to lists except for the restriction that all elements must be of the same type. The copy module (see optional Section 6.19 below) performs shallow and deep copies of objects. The operator module, in addition to the functional equivalents to numeric operators, also contains the same four sequence types. The types module is a reference of type objects representing all types which Python supports, including sequence types. Finally, the UserList module contains a full class implementation of a list object. Because Python types cannot be subclassed, this module allows users to obtain a class that is list-like in nature, and derive new classes or functionality. If you are unfamiliar with object-oriented programming, we highly recommend reading Chapter 13.

Table 6.11. Related Modules for Sequence Types
Module Contents
array features the array restricted mutable sequence type which requires all of its elements to be of the same type
copy provides functionality to perform shallow and deep copies of objects (see 6.19 below for more information)
operator contains sequence operators available as function calls, i.e. operator.concat(m, n) is equivalent to the concatenation (m + n) for sequences m and n.
types contains type objects for all supported Python types
UserList wraps a list object (including operators and methods) into a class which can be used for derivation (also see Section 6.18)


Last updated on 9/14/2001
Core Python Programming, © 2002 Prentice Hall PTR

< BACKMake Note | BookmarkCONTINUE >

© 2002, O'Reilly & Associates, Inc.