Yurttas/PL/SL/python/docs/core-python-programming/doc/152/api/concrete.html

From ZCubes Wiki
Revision as of 18:19, 7 November 2013 by MassBot1 (talk | contribs) (Created page with "<div class="navigation"> {| width="100%" cellspacing="2" align="center" | yurttas/PL/SL/python/docs/core-python-programming/doc/152/api/fundamental.html|[[Image:yurttas...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search


7. Concrete Objects Layer

The functions in this chapter are specific to certain Python object types. Passing them an object of the wrong type is not a good idea; if you receive an object from a Python program and you are not sure that it has the right type, you must perform a type check first; for example. to check that an object is a dictionary, use PyDict_Check(). The chapter is structured like the ``family tree'' of Python object types.



Send comments on this document to python-docs@python.org.

ype.

int PyComplex_Check (PyObject *p)
Returns true if its argument is a PyComplexObject.
PyObject* PyComplex_FromCComplex (Py_complex v)
Return value: New reference.
Create a new Python complex number object from a C Py_complex value.
PyObject* PyComplex_FromDoubles (double real, double imag)
Return value: New reference.
Returns a new PyComplexObject object from real and imag.
double PyComplex_RealAsDouble (PyObject *op)
Returns the real part of op as a C double.
double PyComplex_ImagAsDouble (PyObject *op)
Returns the imaginary part of op as a C double.
Py_complex PyComplex_AsCComplex (PyObject *op)
Returns the Py_complex value of the complex number op.

Send comments on this document to python-docs@python.org.

New reference. Returns a new writable buffer object that maintains its own memory buffer of size bytes. ValueError is returned if size is not zero or positive.

Send comments on this document to python-docs@python.org.

py*