Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1001)

Unified Diff: third_party/cython/src/Cython/Includes/cpython/complex.pxd

Issue 385073004: Adding cython v0.20.2 in third-party. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Reference cython dev list thread. Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/cython/src/Cython/Includes/cpython/complex.pxd
diff --git a/third_party/cython/src/Cython/Includes/cpython/complex.pxd b/third_party/cython/src/Cython/Includes/cpython/complex.pxd
new file mode 100644
index 0000000000000000000000000000000000000000..f5ba339575a25d01035bc78c556f0eb8f75e7988
--- /dev/null
+++ b/third_party/cython/src/Cython/Includes/cpython/complex.pxd
@@ -0,0 +1,50 @@
+
+cdef extern from "Python.h":
+
+ ctypedef struct Py_complex:
+ double imag
+ double real
+
+ ############################################################################
+ # 7.2.5.2 Complex Numbers as Python Objects
+ ############################################################################
+
+ # PyComplexObject
+ # This subtype of PyObject represents a Python complex number object.
+
+ ctypedef class __builtin__.complex [object PyComplexObject]:
+ cdef Py_complex cval
+ # not making these available to keep them read-only:
+ #cdef double imag "cval.imag"
+ #cdef double real "cval.real"
+
+ # PyTypeObject PyComplex_Type
+ # This instance of PyTypeObject represents the Python complex
+ # number type. It is the same object as complex and
+ # types.ComplexType.
+
+ bint PyComplex_Check(object p)
+ # Return true if its argument is a PyComplexObject or a subtype of
+ # PyComplexObject.
+
+ bint PyComplex_CheckExact(object p)
+ # Return true if its argument is a PyComplexObject, but not a subtype of PyComplexObject.
+
+ object PyComplex_FromCComplex(Py_complex v)
+ # Return value: New reference.
+ # Create a new Python complex number object from a C Py_complex value.
+
+ object PyComplex_FromDoubles(double real, double imag)
+ # Return value: New reference.
+ # Return a new PyComplexObject object from real and imag.
+
+ double PyComplex_RealAsDouble(object op) except? -1
+ # Return the real part of op as a C double.
+
+ double PyComplex_ImagAsDouble(object op) except? -1
+ # Return the imaginary part of op as a C double.
+
+ Py_complex PyComplex_AsCComplex(object op)
+ # Return the Py_complex value of the complex number op.
+ #
+ # Returns (-1+0i) in case of an error

Powered by Google App Engine
This is Rietveld 408576698