| 1 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> |
| 2 | <html> |
| 3 | <head> |
| 4 | <link rel="STYLESHEET" href="ref.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="ref.html" title='Python Reference Manual' /> |
| 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="keywords.html" /> |
| 13 | <link rel="parent" href="identifiers.html" /> |
| 14 | <link rel="next" href="literals.html" /> |
| 15 | <meta name='aesop' content='information' /> |
| 16 | <title>2.3.2 Reserved classes of identifiers</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="2.3.1 Keywords" |
| 24 | href="keywords.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="2.3 Identifiers and keywords" |
| 27 | href="identifiers.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="2.4 Literals" |
| 30 | href="literals.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 Reference Manual</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'><img src='../icons/blank.png' |
| 37 | border='0' height='32' alt='' width='32' /></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="keywords.html">2.3.1 Keywords</A> |
| 45 | <b class="navlabel">Up:</b> |
| 46 | <a class="sectref" rel="parent" href="identifiers.html">2.3 Identifiers and keywords</A> |
| 47 | <b class="navlabel">Next:</b> |
| 48 | <a class="sectref" rel="next" href="literals.html">2.4 Literals</A> |
| 49 | </div> |
| 50 | <hr /></div> |
| 51 | </DIV> |
| 52 | <!--End of Navigation Panel--> |
| 53 | |
| 54 | <H2><A NAME="SECTION004320000000000000000"></A><A NAME="id-classes"></A> |
| 55 | <BR> |
| 56 | 2.3.2 Reserved classes of identifiers |
| 57 | </H2> |
| 58 | |
| 59 | <P> |
| 60 | Certain classes of identifiers (besides keywords) have special |
| 61 | meanings. These classes are identified by the patterns of leading and |
| 62 | trailing underscore characters: |
| 63 | |
| 64 | <P> |
| 65 | <DL> |
| 66 | <DT><STRONG><code>_*</code></STRONG></DT> |
| 67 | <DD>Not imported by "<tt class="samp">from <var>module</var> import *</tt>". The special |
| 68 | identifier "<tt class="samp">_</tt>" is used in the interactive interpreter to store |
| 69 | the result of the last evaluation; it is stored in the |
| 70 | <tt class="module">__builtin__</tt> module. When not in interactive mode, "<tt class="samp">_</tt>" has no special meaning and is not defined. |
| 71 | See section <A href="import.html#import">6.12</A>, ``The <tt class="keyword">import</tt> statement.'' |
| 72 | |
| 73 | <P> |
| 74 | <span class="note"><b class="label">Note:</b> |
| 75 | The name "<tt class="samp">_</tt>" is often used in conjunction with |
| 76 | internationalization; refer to the documentation for the |
| 77 | <a class="ulink" href="../lib/module-gettext.html" |
| 78 | ><tt class="module">gettext</tt> module</a> for more |
| 79 | information on this convention.</span> |
| 80 | |
| 81 | <P> |
| 82 | </DD> |
| 83 | <DT><STRONG><code>__*__</code></STRONG></DT> |
| 84 | <DD>System-defined names. These names are defined by the interpreter |
| 85 | and its implementation (including the standard library); |
| 86 | applications should not expect to define additional names using this |
| 87 | convention. The set of names of this class defined by Python may be |
| 88 | extended in future versions. |
| 89 | See section <A href="specialnames.html#specialnames">3.3</A>, ``Special method names.'' |
| 90 | |
| 91 | <P> |
| 92 | </DD> |
| 93 | <DT><STRONG><code>__*</code></STRONG></DT> |
| 94 | <DD>Class-private names. Names in this category, when used within the |
| 95 | context of a class definition, are re-written to use a mangled form |
| 96 | to help avoid name clashes between ``private'' attributes of base |
| 97 | and derived classes. |
| 98 | See section <A href="atom-identifiers.html#atom-identifiers">5.2.1</A>, ``Identifiers (Names).'' |
| 99 | |
| 100 | <P> |
| 101 | </DD> |
| 102 | </DL> |
| 103 | |
| 104 | <P> |
| 105 | |
| 106 | <DIV CLASS="navigation"> |
| 107 | <div class='online-navigation'> |
| 108 | <p></p><hr /> |
| 109 | <table align="center" width="100%" cellpadding="0" cellspacing="2"> |
| 110 | <tr> |
| 111 | <td class='online-navigation'><a rel="prev" title="2.3.1 Keywords" |
| 112 | href="keywords.html"><img src='../icons/previous.png' |
| 113 | border='0' height='32' alt='Previous Page' width='32' /></A></td> |
| 114 | <td class='online-navigation'><a rel="parent" title="2.3 Identifiers and keywords" |
| 115 | href="identifiers.html"><img src='../icons/up.png' |
| 116 | border='0' height='32' alt='Up One Level' width='32' /></A></td> |
| 117 | <td class='online-navigation'><a rel="next" title="2.4 Literals" |
| 118 | href="literals.html"><img src='../icons/next.png' |
| 119 | border='0' height='32' alt='Next Page' width='32' /></A></td> |
| 120 | <td align="center" width="100%">Python Reference Manual</td> |
| 121 | <td class='online-navigation'><a rel="contents" title="Table of Contents" |
| 122 | href="contents.html"><img src='../icons/contents.png' |
| 123 | border='0' height='32' alt='Contents' width='32' /></A></td> |
| 124 | <td class='online-navigation'><img src='../icons/blank.png' |
| 125 | border='0' height='32' alt='' width='32' /></td> |
| 126 | <td class='online-navigation'><a rel="index" title="Index" |
| 127 | href="genindex.html"><img src='../icons/index.png' |
| 128 | border='0' height='32' alt='Index' width='32' /></A></td> |
| 129 | </tr></table> |
| 130 | <div class='online-navigation'> |
| 131 | <b class="navlabel">Previous:</b> |
| 132 | <a class="sectref" rel="prev" href="keywords.html">2.3.1 Keywords</A> |
| 133 | <b class="navlabel">Up:</b> |
| 134 | <a class="sectref" rel="parent" href="identifiers.html">2.3 Identifiers and keywords</A> |
| 135 | <b class="navlabel">Next:</b> |
| 136 | <a class="sectref" rel="next" href="literals.html">2.4 Literals</A> |
| 137 | </div> |
| 138 | </div> |
| 139 | <hr /> |
| 140 | <span class="release-info">Release 2.4.2, documentation updated on 28 September 2005.</span> |
| 141 | </DIV> |
| 142 | <!--End of Navigation Panel--> |
| 143 | <ADDRESS> |
| 144 | See <i><a href="about.html">About this document...</a></i> for information on suggesting changes. |
| 145 | </ADDRESS> |
| 146 | </BODY> |
| 147 | </HTML> |