commit | 81d10b479e99581c26ca4c99d938bbb7c2b16f2e | [log] [tgz] |
---|---|---|
author | Guido van Rossum <guido@python.org> | Tue Jun 16 22:29:03 1998 +0000 |
committer | Guido van Rossum <guido@python.org> | Tue Jun 16 22:29:03 1998 +0000 |
tree | 6392df6039772fccb543ad7a117d867a9f752600 | |
parent | 872948350fbb3d96189671c5bbad55cda1c9e4ff [diff] |
Add __getitem__ to AddressList object, to make it a sequence.
diff --git a/Lib/rfc822.py b/Lib/rfc822.py index ade3506..87d7d39 100644 --- a/Lib/rfc822.py +++ b/Lib/rfc822.py
@@ -728,6 +728,10 @@ 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]: