Commit 81d10b47 authored by Guido van Rossum's avatar Guido van Rossum

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

parent 87294835
......@@ -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]:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment