| 1 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> |
| 2 | <html> |
| 3 | <head> |
| 4 | <link rel="STYLESHEET" href="lib.css" type='text/css' /> |
| 5 | <link rel="SHORTCUT ICON" href="../icons/pyfav.png" type="image/png" /> |
| 6 | <link rel='start' href='../index.html' title='Python Documentation Index' /> |
| 7 | <link rel="first" href="lib.html" title='Python Library Reference' /> |
| 8 | <link rel='contents' href='contents.html' title="Contents" /> |
| 9 | <link rel='index' href='genindex.html' title='Index' /> |
| 10 | <link rel='last' href='about.html' title='About this document...' /> |
| 11 | <link rel='help' href='about.html' title='About this document...' /> |
| 12 | <link rel="prev" href="message-objects.html" /> |
| 13 | <link rel="parent" href="module-rfc822.html" /> |
| 14 | <link rel="next" href="module-base64.html" /> |
| 15 | <meta name='aesop' content='information' /> |
| 16 | <title>12.11.2 AddressList Objects </title> |
| 17 | </head> |
| 18 | <body> |
| 19 | <DIV CLASS="navigation"> |
| 20 | <div id='top-navigation-panel' xml:id='top-navigation-panel'> |
| 21 | <table align="center" width="100%" cellpadding="0" cellspacing="2"> |
| 22 | <tr> |
| 23 | <td class='online-navigation'><a rel="prev" title="12.11.1 Message Objects" |
| 24 | href="message-objects.html"><img src='../icons/previous.png' |
| 25 | border='0' height='32' alt='Previous Page' width='32' /></A></td> |
| 26 | <td class='online-navigation'><a rel="parent" title="12.11 rfc822 " |
| 27 | href="module-rfc822.html"><img src='../icons/up.png' |
| 28 | border='0' height='32' alt='Up One Level' width='32' /></A></td> |
| 29 | <td class='online-navigation'><a rel="next" title="12.12 base64 " |
| 30 | href="module-base64.html"><img src='../icons/next.png' |
| 31 | border='0' height='32' alt='Next Page' width='32' /></A></td> |
| 32 | <td align="center" width="100%">Python Library Reference</td> |
| 33 | <td class='online-navigation'><a rel="contents" title="Table of Contents" |
| 34 | href="contents.html"><img src='../icons/contents.png' |
| 35 | border='0' height='32' alt='Contents' width='32' /></A></td> |
| 36 | <td class='online-navigation'><a href="modindex.html" title="Module Index"><img src='../icons/modules.png' |
| 37 | border='0' height='32' alt='Module Index' width='32' /></a></td> |
| 38 | <td class='online-navigation'><a rel="index" title="Index" |
| 39 | href="genindex.html"><img src='../icons/index.png' |
| 40 | border='0' height='32' alt='Index' width='32' /></A></td> |
| 41 | </tr></table> |
| 42 | <div class='online-navigation'> |
| 43 | <b class="navlabel">Previous:</b> |
| 44 | <a class="sectref" rel="prev" href="message-objects.html">12.11.1 Message Objects</A> |
| 45 | <b class="navlabel">Up:</b> |
| 46 | <a class="sectref" rel="parent" href="module-rfc822.html">12.11 rfc822 </A> |
| 47 | <b class="navlabel">Next:</b> |
| 48 | <a class="sectref" rel="next" href="module-base64.html">12.12 base64 </A> |
| 49 | </div> |
| 50 | <hr /></div> |
| 51 | </DIV> |
| 52 | <!--End of Navigation Panel--> |
| 53 | |
| 54 | <H2><A NAME="SECTION00141120000000000000000"></A><A NAME="addresslist-objects"></A> |
| 55 | <BR> |
| 56 | 12.11.2 AddressList Objects |
| 57 | </H2> |
| 58 | |
| 59 | <P> |
| 60 | An <tt class="class">AddressList</tt> instance has the following methods: |
| 61 | |
| 62 | <P> |
| 63 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> |
| 64 | <td><nobr><b><tt id='l2h-4100' xml:id='l2h-4100' class="method">__len__</tt></b>(</nobr></td> |
| 65 | <td><var></var>)</td></tr></table></dt> |
| 66 | <dd> |
| 67 | Return the number of addresses in the address list. |
| 68 | </dl> |
| 69 | |
| 70 | <P> |
| 71 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> |
| 72 | <td><nobr><b><tt id='l2h-4101' xml:id='l2h-4101' class="method">__str__</tt></b>(</nobr></td> |
| 73 | <td><var></var>)</td></tr></table></dt> |
| 74 | <dd> |
| 75 | Return a canonicalized string representation of the address list. |
| 76 | Addresses are rendered in "name" <host@domain> form, comma-separated. |
| 77 | </dl> |
| 78 | |
| 79 | <P> |
| 80 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> |
| 81 | <td><nobr><b><tt id='l2h-4102' xml:id='l2h-4102' class="method">__add__</tt></b>(</nobr></td> |
| 82 | <td><var>alist</var>)</td></tr></table></dt> |
| 83 | <dd> |
| 84 | Return a new <tt class="class">AddressList</tt> instance that contains all addresses |
| 85 | in both <tt class="class">AddressList</tt> operands, with duplicates removed (set |
| 86 | union). |
| 87 | </dl> |
| 88 | |
| 89 | <P> |
| 90 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> |
| 91 | <td><nobr><b><tt id='l2h-4103' xml:id='l2h-4103' class="method">__iadd__</tt></b>(</nobr></td> |
| 92 | <td><var>alist</var>)</td></tr></table></dt> |
| 93 | <dd> |
| 94 | In-place version of <tt class="method">__add__()</tt>; turns this <tt class="class">AddressList</tt> |
| 95 | instance into the union of itself and the right-hand instance, |
| 96 | <var>alist</var>. |
| 97 | </dl> |
| 98 | |
| 99 | <P> |
| 100 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> |
| 101 | <td><nobr><b><tt id='l2h-4104' xml:id='l2h-4104' class="method">__sub__</tt></b>(</nobr></td> |
| 102 | <td><var>alist</var>)</td></tr></table></dt> |
| 103 | <dd> |
| 104 | Return a new <tt class="class">AddressList</tt> instance that contains every address |
| 105 | in the left-hand <tt class="class">AddressList</tt> operand that is not present in |
| 106 | the right-hand address operand (set difference). |
| 107 | </dl> |
| 108 | |
| 109 | <P> |
| 110 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> |
| 111 | <td><nobr><b><tt id='l2h-4105' xml:id='l2h-4105' class="method">__isub__</tt></b>(</nobr></td> |
| 112 | <td><var>alist</var>)</td></tr></table></dt> |
| 113 | <dd> |
| 114 | In-place version of <tt class="method">__sub__()</tt>, removing addresses in this |
| 115 | list which are also in <var>alist</var>. |
| 116 | </dl> |
| 117 | |
| 118 | <P> |
| 119 | Finally, <tt class="class">AddressList</tt> instances have one public instance variable: |
| 120 | |
| 121 | <P> |
| 122 | <dl><dt><b><tt id='l2h-4106' xml:id='l2h-4106' class="member">addresslist</tt></b></dt> |
| 123 | <dd> |
| 124 | A list of tuple string pairs, one per address. In each member, the |
| 125 | first is the canonicalized name part, the second is the |
| 126 | actual route-address ("<tt class="character">@</tt>"-separated username-host.domain |
| 127 | pair). |
| 128 | </dl> |
| 129 | |
| 130 | <P> |
| 131 | |
| 132 | <DIV CLASS="navigation"> |
| 133 | <div class='online-navigation'> |
| 134 | <p></p><hr /> |
| 135 | <table align="center" width="100%" cellpadding="0" cellspacing="2"> |
| 136 | <tr> |
| 137 | <td class='online-navigation'><a rel="prev" title="12.11.1 Message Objects" |
| 138 | href="message-objects.html"><img src='../icons/previous.png' |
| 139 | border='0' height='32' alt='Previous Page' width='32' /></A></td> |
| 140 | <td class='online-navigation'><a rel="parent" title="12.11 rfc822 " |
| 141 | href="module-rfc822.html"><img src='../icons/up.png' |
| 142 | border='0' height='32' alt='Up One Level' width='32' /></A></td> |
| 143 | <td class='online-navigation'><a rel="next" title="12.12 base64 " |
| 144 | href="module-base64.html"><img src='../icons/next.png' |
| 145 | border='0' height='32' alt='Next Page' width='32' /></A></td> |
| 146 | <td align="center" width="100%">Python Library Reference</td> |
| 147 | <td class='online-navigation'><a rel="contents" title="Table of Contents" |
| 148 | href="contents.html"><img src='../icons/contents.png' |
| 149 | border='0' height='32' alt='Contents' width='32' /></A></td> |
| 150 | <td class='online-navigation'><a href="modindex.html" title="Module Index"><img src='../icons/modules.png' |
| 151 | border='0' height='32' alt='Module Index' width='32' /></a></td> |
| 152 | <td class='online-navigation'><a rel="index" title="Index" |
| 153 | href="genindex.html"><img src='../icons/index.png' |
| 154 | border='0' height='32' alt='Index' width='32' /></A></td> |
| 155 | </tr></table> |
| 156 | <div class='online-navigation'> |
| 157 | <b class="navlabel">Previous:</b> |
| 158 | <a class="sectref" rel="prev" href="message-objects.html">12.11.1 Message Objects</A> |
| 159 | <b class="navlabel">Up:</b> |
| 160 | <a class="sectref" rel="parent" href="module-rfc822.html">12.11 rfc822 </A> |
| 161 | <b class="navlabel">Next:</b> |
| 162 | <a class="sectref" rel="next" href="module-base64.html">12.12 base64 </A> |
| 163 | </div> |
| 164 | </div> |
| 165 | <hr /> |
| 166 | <span class="release-info">Release 2.4.2, documentation updated on 28 September 2005.</span> |
| 167 | </DIV> |
| 168 | <!--End of Navigation Panel--> |
| 169 | <ADDRESS> |
| 170 | See <i><a href="about.html">About this document...</a></i> for information on suggesting changes. |
| 171 | </ADDRESS> |
| 172 | </BODY> |
| 173 | </HTML> |