267.html

来自「Python Ebook Python&XML」· HTML 代码 · 共 46 行

HTML
46
字号

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Robots" content="INDEX,NOFOLLOW">
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<TITLE>Safari | Python Developer's Handbook -&gt; Defining New Object Types</TITLE>
<LINK REL="stylesheet" HREF="oreillyi/oreillyN.css">
</HEAD>
<BODY bgcolor="white" text="black" link="#990000" vlink="#990000" alink="#990000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">

<table width="100%" cellpadding=5 cellspacing=0 border=0 class="navtopbg"><tr><td><font size="1"><p class="navtitle"><a href="8.html" class="navtitle">Web Development</a> &gt; <a href="0672319942.html" class="navtitle">Python Developer's Handbook</a> &gt; <a href="255.html" class="navtitle">A. Python/C API</a> &gt; <span class="nonavtitle">Defining New Object Types</span></p></font></td><td align="right" valign="top" nowrap><font size="1"><a href="main.asp?list" class="safnavoff">See All Titles</a></font></td></tr></table>
<TABLE width=100% bgcolor=white border=0 cellspacing=0 cellpadding=5><TR><TD>
<TABLE border=0 width="100%" cellspacing=0 cellpadding=0><TR><td align=left width="15%" class="headingsubbarbg"><a href="266.html" title="Memory Management"><font size="1">&lt;&nbsp;BACK</font></a></td><td align=center width="70%" class="headingsubbarbg"><font size="1"><a href="popanote.asp?pubui=oreilly&bookname=0672319942&snode=267" target="_blank" title="Make a public or private annnotation">Make Note</a> | <a href="267.html" title="Use a Safari bookmark to remember this section">Bookmark</a></font></td><td align=right width="15%" class="headingsubbarbg"><a href="269.html" title="B. Running Python on Specific Platforms"><font size="1">CONTINUE&nbsp;&gt;</font></a></td></TR></TABLE>
<a href="6%2F1%2F2002+6%3A30%3A53+PM.html" TABINDEX="-1"><img src=images/spacer.gif border=0 width=1 height=1></a><font color=white size=1>152015024128143245168232148039196038240039088173205162105045222219255189230213165015209</font><a href="read4.asp?bookname=0672319942&snode=267&now=6%2F1%2F2002+6%3A30%3A53+PM" TABINDEX="-1"><img src=images/spacer.gif border=0 width=1 height=1></a><br>
<FONT><h3>Defining New Object Types</h3><prE>
					
PyObject* _PyObject_New(PyTypeObject *type)

				</PRE>

				<p>Return value: New reference.</p>

				<prE>
					
PyObject* _PyObject_NewVar(PyTypeObject *type, int size)

				</PRE>

				<p>Return value: New reference.<a naME="idx1073751313"></A></P>

				<h4>Common Object Structures</h4>
					<p>Next, you have a list of object structures commonly used in type and method definitions.</p>

					<p><table border="1" cellSpaCing="0" CellpAddiNG="1" WIdth="100%">
<cOLGRoup aLIGN="left" span="3">
<TR>
<TD valign="top">
<font size="2"><tt clasS="monofont">PyObject</tt>
									</Font></Td>
<td vAligN="top">
<FONt sizE="2"><TT Class="monofont">PyVarObject</TT>
									</FOnt></td>
<TD VAlign="top">
<font size="2">

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?