(original) (raw)
On Wed, Sep 29, 2010 at 11:29 PM, Terry Reedy <tjreedy@udel.edu> wrote:
Does this violate the Sequence ABC (assuming there is one)?
There is a Sequence ABC, but it does not define \_\_add\_\_. It only defines the following methods:
\_\_contains\_\_, \_\_getitem\_\_, \_\_iter\_\_, \_\_len\_\_, \_\_reversed\_\_, count, and index
\_\_contains\_\_, \_\_getitem\_\_, \_\_iter\_\_, \_\_len\_\_, \_\_reversed\_\_, count, and index
tuple, range, and str types all register as following the Sequence ABC.
list and bytearray types register as following the MutableSequence ABC, which is a subclass of the Sequence ABC.