Package posterity :: Package util :: Module mail :: Class EmailAddressList

Class EmailAddressList



object --+
         |
        EmailAddressList

Email address list class

The purpose of this class is to make it easier to work with email address containing strings.

>>> a1 = EmailAddressList('Name 1 <1@foo.com>')
>>> a2 = EmailAddressList('2@foo.com')
>>> a3 = EmailAddressList('3@foo.com, 4@foo.com')
>>> str(a1 + a3)
'Name 1 <1@foo.com>, 3@foo.com, 4@foo.com'

Duplicate entires are automatically removed: >>> str(a1 + a2 + a2 + a1) 'Name 1 <1@foo.com>, 2@foo.com'

It is also easy to remove entries from a list: >>> str(a3 - '3@foo.com') '4@foo.com'



Instance Methods
 
__init__(self, *args)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
 
__repr__(self)
repr(x)
 
__str__(self)
str(x)
 
__getitem__(self, item)
 
__len__(self)
 
__iter__(self)
 
__contains__(self, other)
 
__add__(self, other)
 
__sub__(self, other)

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __setattr__

Properties

Inherited from object: __class__

Method Details

__init__(self, *args)
(Constructor)

 
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
Overrides: object.__init__
(inherited documentation)

__repr__(self)
(Representation operator)

 
repr(x)
Overrides: object.__repr__
(inherited documentation)

__str__(self)
(Informal representation operator)

 
str(x)
Overrides: object.__str__
(inherited documentation)