Add __getitem__ to AddressList object, to make it a sequence.

This commit is contained in:
Guido van Rossum 1998-06-16 22:29:03 +00:00
parent 872948350f
commit 81d10b479e

View file

@ -728,6 +728,10 @@ class AddressList(AddrlistClass):
newaddr.addresslist.append(x)
return newaddr
def __getitem__(self, index):
# Make indexing, slices, and 'in' work
return self.addrlist[index]
def dump_address_pair(pair):
"""Dump a (name, address) pair in a canonicalized form."""
if pair[0]: