📄 appendixd.htm
字号:
<td> </td>
</tr>
<tr>
<td colSpan="3"> </td>
</tr>
<tr>
<td colSpan="3" height="1"></td>
</tr>
</table>
</a><a name="{1131}">
<table cellSpacing="0" cellPadding="0" border="0">
<tr>
<td rowSpan="5"> </td>
<td colSpan="3" height="12"></td>
<td rowSpan="5"> </td>
</tr>
<tr>
<td colSpan="3"> </td>
</tr>
<tr>
<td> </td>
<td><font face="Courier New, Courier, Mono New, Courier, Mono" size="3">
<b>__complex__(<i>self)<br>
</i></b></font><font face="Times New Roman, Times, Serif" size="3">
Numeric; if your class can be converted to a complex number, return that
complex equivalent.</font></td>
<td> </td>
</tr>
<tr>
<td colSpan="3"> </td>
</tr>
<tr>
<td colSpan="3" height="1"></td>
</tr>
</table>
</a><a name="{1132}">
<table cellSpacing="0" cellPadding="0" border="0">
<tr>
<td rowSpan="5"> </td>
<td colSpan="3" height="12"></td>
<td rowSpan="5"> </td>
</tr>
<tr>
<td colSpan="3"> </td>
</tr>
<tr>
<td> </td>
<td><font face="Courier New, Courier, Mono New, Courier, Mono" size="3">
<b>__del__(<i>self)<br>
</i></b></font><font face="Times New Roman, Times, Serif" size="3">
Class; called when an instance of your class is about to be destroyed.
Lots of gotchas; see Chapter 13 for details.</font></td>
<td> </td>
</tr>
<tr>
<td colSpan="3"> </td>
</tr>
<tr>
<td colSpan="3" height="1"></td>
</tr>
</table>
</a><a name="{1133}">
<table cellSpacing="0" cellPadding="0" border="0">
<tr>
<td rowSpan="5"> </td>
<td colSpan="3" height="12"></td>
<td rowSpan="5"> </td>
</tr>
<tr>
<td colSpan="3"> </td>
</tr>
<tr>
<td> </td>
<td><font face="Courier New, Courier, Mono New, Courier, Mono" size="3">
<b>__delattr__(<i>self,name)<br>
</i></b></font><font face="Times New Roman, Times, Serif" size="3">
Access; called when </font>
<font face="Courier New, Courier, Mono New, Courier, Mono" size="3">del object.<i>name</i></font><font face="Times New Roman, Times, Serif" size="3">
is called.</font></td>
<td> </td>
</tr>
<tr>
<td colSpan="3"> </td>
</tr>
<tr>
<td colSpan="3" height="1"></td>
</tr>
</table>
</a><a name="{1134}">
<table cellSpacing="0" cellPadding="0" border="0">
<tr>
<td rowSpan="5"> </td>
<td colSpan="3" height="12"></td>
<td rowSpan="5"> </td>
</tr>
<tr>
<td colSpan="3"> </td>
</tr>
<tr>
<td> </td>
<td><font face="Courier New, Courier, Mono New, Courier, Mono" size="3">
<b>__delitem__(<i>self,key)<br>
</i></b></font><font face="Times New Roman, Times, Serif" size="3">
Sequence and mapping; called when </font>
<font face="Courier New, Courier, Mono New, Courier, Mono" size="3">del object[<i>key]</i></font><font face="Times New Roman, Times, Serif" size="3">
is called.</font></td>
<td> </td>
</tr>
<tr>
<td colSpan="3"> </td>
</tr>
<tr>
<td colSpan="3" height="1"></td>
</tr>
</table>
</a><a name="{1135}">
<table cellSpacing="0" cellPadding="0" border="0">
<tr>
<td rowSpan="5"> </td>
<td colSpan="3" height="12"></td>
<td rowSpan="5"> </td>
</tr>
<tr>
<td colSpan="3"> </td>
</tr>
<tr>
<td> </td>
<td><font face="Courier New, Courier, Mono New, Courier, Mono" size="3">
<b>__delslice__(<i>self,i,j)<br>
</i></b></font><font face="Times New Roman, Times, Serif" size="3">
Sequence and mapping; called when </font>
<font face="Courier New, Courier, Mono New, Courier, Mono" size="3">del object[<i>i:j]</i></font><font face="Times New Roman, Times, Serif" size="3">
is called.</font><font face="Times New Roman, Times, Serif" color="#ffff00" size="3"><!-- break --></font></td>
<td> </td>
</tr>
<tr>
<td colSpan="3"> </td>
</tr>
<tr>
<td colSpan="3" height="1"></td>
</tr>
</table>
</a><a name="{1136}">
<p> </a></td>
</tr>
</table>
<p><font color="white" size="0"></p>
</center>
<p><a name="bottom"> </a>
<!-- netLibrary.com Copyright Notice --></font></p>
<p> </p>
<center>
<table cellPadding="0" width="100%" border="0">
<tr>
<td align="middle">
<table cellSpacing="0" cellPadding="2" width="100%" border="0">
<tr>
<td align="left"> </td>
<td align="right"> </td>
</tr>
</table>
</td>
</tr>
<tr>
<td align="left"><a name="{1137}">
<table cellSpacing="0" cellPadding="0" width="100%" border="0">
<tr>
<td align="right">
<font face="Times New Roman, Times, Serif" color="#ff0000" size="2">Page
477</font></td>
</tr>
</table>
</a><a name="{1138}">
<table cellSpacing="0" cellPadding="0" border="0">
<tr>
<td rowSpan="5"> </td>
<td colSpan="3" height="12"></td>
<td rowSpan="5"> </td>
</tr>
<tr>
<td colSpan="3"> </td>
</tr>
<tr>
<td> </td>
<td><font face="Courier New, Courier, Mono New, Courier, Mono" size="3">
<b>__div__(<i>self,other)<br>
</i></b></font><font face="Times New Roman, Times, Serif" size="3">
Numeric; divide </font>
<font face="Courier New, Courier, Mono New, Courier, Mono" size="3"><i>
self</i></font><font face="Times New Roman, Times, Serif" size="3"> by
</font>
<font face="Courier New, Courier, Mono New, Courier, Mono" size="3"><i>
other</i></font><font face="Times New Roman, Times, Serif" size="3"> and
return the result.</font></td>
<td> </td>
</tr>
<tr>
<td colSpan="3"> </td>
</tr>
<tr>
<td colSpan="3" height="1"></td>
</tr>
</table>
</a><a name="{1139}">
<table cellSpacing="0" cellPadding="0" border="0">
<tr>
<td rowSpan="5"> </td>
<td colSpan="3" height="12"></td>
<td rowSpan="5"> </td>
</tr>
<tr>
<td colSpan="3"> </td>
</tr>
<tr>
<td> </td>
<td><font face="Courier New, Courier, Mono New, Courier, Mono" size="3">
<b>__divmod__(<i>self,other)<br>
</i></b></font><font face="Times New Roman, Times, Serif" size="3">
Numeric; divide </font>
<font face="Courier New, Courier, Mono New, Courier, Mono" size="3"><i>
self</i></font><font face="Times New Roman, Times, Serif" size="3"> by
</font>
<font face="Courier New, Courier, Mono New, Courier, Mono" size="3"><i>
other</i></font><font face="Times New Roman, Times, Serif" size="3"> and
return a tuple of the result and the remainder.</font></td>
<td> </td>
</tr>
<tr>
<td colSpan="3"> </td>
</tr>
<tr>
<td colSpan="3" height="1"></td>
</tr>
</table>
</a><a name="{113A}">
<table cellSpacing="0" cellPadding="0" border="0">
<tr>
<td rowSpan="5"> </td>
<td colSpan="3" height="12"></td>
<td rowSpan="5"> </td>
</tr>
<tr>
<td colSpan="3"> </td>
</tr>
<tr>
<td> </td>
<td><font face="Courier New, Courier, Mono New, Courier, Mono" size="3">
<b>__float__(<i>self)<br>
</i></b></font><font face="Times New Roman, Times, Serif" size="3">
Numeric; if your class can be converted to a floating point number,
return that floating point equivalent.</font></td>
<td> </td>
</tr>
<tr>
<td colSpan="3"> </td>
</tr>
<tr>
<td colSpan="3" height="1"></td>
</tr>
</table>
</a><a name="{113B}">
<table cellSpacing="0" cellPadding="0" border="0">
<tr>
<td rowSpan="5"> </td>
<td colSpan="3" height="12"></td>
<td rowSpan="5"> </td>
</tr>
<tr>
<td colSpan="3"> </td>
</tr>
<tr>
<td> </td>
<td><font face="Courier New, Courier, Mono New, Courier, Mono" size="3">
<b>__getattr__(<i>self,name)<br>
</i></b></font><font face="Times New Roman, Times, Serif" size="3">
Access; called only if </font>
<font face="Courier New, Courier, Mono New, Courier, Mono" size="3">
object.<i>attribute</i></font><font face="Times New Roman, Times, Serif" size="3">
lookup fails. Return the value of </font>
<font face="Courier New, Courier, Mono New, Courier, Mono" size="3"><i>
attribute</i></font><font face="Times New Roman, Times, Serif" size="3">
or raise </font>
<font face="Courier New, Courier, Mono New, Courier, Mono" size="3">
AttributeError</font><font face="Times New Roman, Times, Serif" size="3">.</font></td>
<td> </td>
</tr>
<tr>
<td colSpan="3"> </td>
</tr>
<tr>
<td colSpan="3" height="1"></td>
</tr>
</table>
</a><a name="{113C}">
<table cellSpacing="0" cellPadding="0" border="0">
<tr>
<td rowSpan="5"> </td>
<td colSpan="3" height="12"></td>
<td rowSpan="5"> </td>
</tr>
<tr>
<td colSpan="3"> </td>
</tr>
<tr>
<td> </td>
<td><font face="Courier New, Courier, Mono New, Courier, Mono" size="3">
<b>__getitem__(<i>self,key)<br>
</i></b></font><font face="Times New Roman, Times, Serif" size="3">
Sequence and mapping; called when a call to </font>
<font face="Courier New, Courier, Mono New, Courier, Mono" size="3">
object[<i>key]</i></font><font face="Times New Roman, Times, Serif" size="3">
is made. Keys are usually integers; negative index implementation must
be done in this method if your class supports it.</font></td>
<td> </td>
</tr>
<tr>
<td colSpan="3"> </td>
</tr>
<tr>
<td colSpan="3" height="1"></td>
</tr>
</table>
</a><a name="{113D}">
<table cellSpacing="0" cellPadding="0" border="0">
<tr>
<td rowSpan="5"> </td>
<td colSpan="3" height="12"></td>
<td rowSpan="5"> </td>
</tr>
<tr>
<td colSpan="3"> </td>
</tr>
<tr>
<td> </td>
<td><font face="Courier New, Courier, Mono New, Courier, Mono" size="3">
<b>__getslice__(<i>self,i,j)<br>
</i></b></font><font face="Times New Roman, Times, Serif" size="3">
Sequence and mapping; called when a call to </font>
<font face="Courier New, Courier, Mono New, Courier, Mono" size="3">
object[<i>i:j]</i></font><font face="Times New Roman, Times, Serif" size="3">
is made. Both <i>i</i> and <i>j</i> are integers; negative index
implementation is up to this method.</font></td>
<td> </td>
</tr>
<tr>
<td colSpan="3"> </td>
</tr>
<tr>
<td colSpan="3" height="1"></td>
</tr>
</table>
</a><a name="{113E}">
<table cellSpacing="0" cellPadding="0" border="0">
<tr>
<td rowSpan="5"> </td>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -