annotate Include/complexobject.h @ 58664:993f703a61ba

Merged revisions 77484,77487,77561,77570,77593,77603,77608,77667,77702-77703,77739,77858,77887,77889 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r77484 | skip.montanaro | 2010-01-13 19:12:34 -0600 (Wed, 13 Jan 2010) | 4 lines Update PyEval_EvalFrame to PyEval_EvalFrameEx. This looks to have been done partially before. Also add a comment describing how this might have to work with different versions of the interpreter. ........ r77487 | ezio.melotti | 2010-01-14 05:34:10 -0600 (Thu, 14 Jan 2010) | 1 line Fixed typo ........ r77561 | georg.brandl | 2010-01-17 02:42:30 -0600 (Sun, 17 Jan 2010) | 1 line #7699: improve datetime docs: straightforward linking to strftime/strptime section, mark classmethods as such. ........ r77570 | georg.brandl | 2010-01-17 06:14:42 -0600 (Sun, 17 Jan 2010) | 1 line Add note about usage of STRINGLIB_EMPTY. ........ r77593 | georg.brandl | 2010-01-17 17:33:53 -0600 (Sun, 17 Jan 2010) | 1 line Fix internal reference. ........ r77603 | benjamin.peterson | 2010-01-18 17:07:56 -0600 (Mon, 18 Jan 2010) | 8 lines data descriptors do not override the class dictionary if __get__ is not defined Adjust documentation and add a test to verify this behavior. See http://mail.python.org/pipermail/python-dev/2010-January/095637.html for discussion. ........ r77608 | gregory.p.smith | 2010-01-19 02:19:03 -0600 (Tue, 19 Jan 2010) | 6 lines Do not compile stubs for the sha2 series hashes in the openssl hashlib module when the openssl version is too old to support them. That leads both compiled code bloat and to unittests attempting to test implementations that don't exist for comparison purposes on such platforms. ........ r77667 | mark.dickinson | 2010-01-21 12:32:27 -0600 (Thu, 21 Jan 2010) | 1 line Add two more test_strtod test values. ........ r77702 | georg.brandl | 2010-01-23 02:43:31 -0600 (Sat, 23 Jan 2010) | 1 line #7762: fix refcount annotation of PyUnicode_Tailmatch(). ........ r77703 | georg.brandl | 2010-01-23 02:47:54 -0600 (Sat, 23 Jan 2010) | 1 line #7725: fix referencing issue. ........ r77739 | benjamin.peterson | 2010-01-24 21:52:52 -0600 (Sun, 24 Jan 2010) | 1 line mention from_float() in error message ........ r77858 | georg.brandl | 2010-01-30 11:57:48 -0600 (Sat, 30 Jan 2010) | 1 line #7802: fix invalid example (heh). ........ r77887 | georg.brandl | 2010-01-31 12:51:49 -0600 (Sun, 31 Jan 2010) | 5 lines Fix-up ftplib documentation: move exception descriptions to toplevel, not inside a class remove attribution in "versionadded" spell and grammar check docstring of FTP_TLS ........ r77889 | michael.foord | 2010-01-31 13:59:26 -0600 (Sun, 31 Jan 2010) | 1 line Minor modification to unittest documentation. ........
author Benjamin Peterson <benjamin@python.org>
date Wed, 03 Feb 2010 02:35:45 +0000
parents 2cde0d003ffc
children 62b61abd02b8
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
13444
5709ddba423c ANSI-fication and Py_PROTO extermination.
Fred Drake <fdrake@acm.org>
parents: 9586
diff changeset
1 /* Complex number structure */
5709ddba423c ANSI-fication and Py_PROTO extermination.
Fred Drake <fdrake@acm.org>
parents: 9586
diff changeset
2
25554
36124157b317 SF # 607253, header file problems by Ralf W. Grosse-Kunstleve
Neal Norwitz <nnorwitz@gmail.com>
parents: 24752
diff changeset
3 #ifndef Py_COMPLEXOBJECT_H
36124157b317 SF # 607253, header file problems by Ralf W. Grosse-Kunstleve
Neal Norwitz <nnorwitz@gmail.com>
parents: 24752
diff changeset
4 #define Py_COMPLEXOBJECT_H
3316
e5d1f242daf9 complex numbers a la Konrad Hinsen
Guido van Rossum <guido@python.org>
parents:
diff changeset
5 #ifdef __cplusplus
e5d1f242daf9 complex numbers a la Konrad Hinsen
Guido van Rossum <guido@python.org>
parents:
diff changeset
6 extern "C" {
e5d1f242daf9 complex numbers a la Konrad Hinsen
Guido van Rossum <guido@python.org>
parents:
diff changeset
7 #endif
e5d1f242daf9 complex numbers a la Konrad Hinsen
Guido van Rossum <guido@python.org>
parents:
diff changeset
8
e5d1f242daf9 complex numbers a la Konrad Hinsen
Guido van Rossum <guido@python.org>
parents:
diff changeset
9 typedef struct {
13444
5709ddba423c ANSI-fication and Py_PROTO extermination.
Fred Drake <fdrake@acm.org>
parents: 9586
diff changeset
10 double real;
5709ddba423c ANSI-fication and Py_PROTO extermination.
Fred Drake <fdrake@acm.org>
parents: 9586
diff changeset
11 double imag;
3765
db5488fe495b renamed complex -> Py_complex
Guido van Rossum <guido@python.org>
parents: 3613
diff changeset
12 } Py_complex;
3316
e5d1f242daf9 complex numbers a la Konrad Hinsen
Guido van Rossum <guido@python.org>
parents:
diff changeset
13
e5d1f242daf9 complex numbers a la Konrad Hinsen
Guido van Rossum <guido@python.org>
parents:
diff changeset
14 /* Operations on complex numbers from complexmodule.c */
e5d1f242daf9 complex numbers a la Konrad Hinsen
Guido van Rossum <guido@python.org>
parents:
diff changeset
15
3613
2f314ca0cd33 rename exported symbols with _Py_ prefix
Guido van Rossum <guido@python.org>
parents: 3321
diff changeset
16 #define c_sum _Py_c_sum
2f314ca0cd33 rename exported symbols with _Py_ prefix
Guido van Rossum <guido@python.org>
parents: 3321
diff changeset
17 #define c_diff _Py_c_diff
2f314ca0cd33 rename exported symbols with _Py_ prefix
Guido van Rossum <guido@python.org>
parents: 3321
diff changeset
18 #define c_neg _Py_c_neg
2f314ca0cd33 rename exported symbols with _Py_ prefix
Guido van Rossum <guido@python.org>
parents: 3321
diff changeset
19 #define c_prod _Py_c_prod
2f314ca0cd33 rename exported symbols with _Py_ prefix
Guido van Rossum <guido@python.org>
parents: 3321
diff changeset
20 #define c_quot _Py_c_quot
2f314ca0cd33 rename exported symbols with _Py_ prefix
Guido van Rossum <guido@python.org>
parents: 3321
diff changeset
21 #define c_pow _Py_c_pow
46477
b69f443ef480 Merged revisions 62380,62382-62383 via svnmerge from
Christian Heimes <christian@cheimes.de>
parents: 44351
diff changeset
22 #define c_abs _Py_c_abs
3613
2f314ca0cd33 rename exported symbols with _Py_ prefix
Guido van Rossum <guido@python.org>
parents: 3321
diff changeset
23
24752
c1eb668525e1 Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents: 19889
diff changeset
24 PyAPI_FUNC(Py_complex) c_sum(Py_complex, Py_complex);
c1eb668525e1 Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents: 19889
diff changeset
25 PyAPI_FUNC(Py_complex) c_diff(Py_complex, Py_complex);
c1eb668525e1 Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents: 19889
diff changeset
26 PyAPI_FUNC(Py_complex) c_neg(Py_complex);
c1eb668525e1 Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents: 19889
diff changeset
27 PyAPI_FUNC(Py_complex) c_prod(Py_complex, Py_complex);
c1eb668525e1 Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents: 19889
diff changeset
28 PyAPI_FUNC(Py_complex) c_quot(Py_complex, Py_complex);
c1eb668525e1 Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents: 19889
diff changeset
29 PyAPI_FUNC(Py_complex) c_pow(Py_complex, Py_complex);
46477
b69f443ef480 Merged revisions 62380,62382-62383 via svnmerge from
Christian Heimes <christian@cheimes.de>
parents: 44351
diff changeset
30 PyAPI_FUNC(double) c_abs(Py_complex);
3316
e5d1f242daf9 complex numbers a la Konrad Hinsen
Guido van Rossum <guido@python.org>
parents:
diff changeset
31
e5d1f242daf9 complex numbers a la Konrad Hinsen
Guido van Rossum <guido@python.org>
parents:
diff changeset
32
e5d1f242daf9 complex numbers a la Konrad Hinsen
Guido van Rossum <guido@python.org>
parents:
diff changeset
33 /* Complex object interface */
e5d1f242daf9 complex numbers a la Konrad Hinsen
Guido van Rossum <guido@python.org>
parents:
diff changeset
34
e5d1f242daf9 complex numbers a la Konrad Hinsen
Guido van Rossum <guido@python.org>
parents:
diff changeset
35 /*
e5d1f242daf9 complex numbers a la Konrad Hinsen
Guido van Rossum <guido@python.org>
parents:
diff changeset
36 PyComplexObject represents a complex number with double-precision
e5d1f242daf9 complex numbers a la Konrad Hinsen
Guido van Rossum <guido@python.org>
parents:
diff changeset
37 real and imaginary parts.
e5d1f242daf9 complex numbers a la Konrad Hinsen
Guido van Rossum <guido@python.org>
parents:
diff changeset
38 */
e5d1f242daf9 complex numbers a la Konrad Hinsen
Guido van Rossum <guido@python.org>
parents:
diff changeset
39
e5d1f242daf9 complex numbers a la Konrad Hinsen
Guido van Rossum <guido@python.org>
parents:
diff changeset
40 typedef struct {
13444
5709ddba423c ANSI-fication and Py_PROTO extermination.
Fred Drake <fdrake@acm.org>
parents: 9586
diff changeset
41 PyObject_HEAD
5709ddba423c ANSI-fication and Py_PROTO extermination.
Fred Drake <fdrake@acm.org>
parents: 9586
diff changeset
42 Py_complex cval;
3316
e5d1f242daf9 complex numbers a la Konrad Hinsen
Guido van Rossum <guido@python.org>
parents:
diff changeset
43 } PyComplexObject;
e5d1f242daf9 complex numbers a la Konrad Hinsen
Guido van Rossum <guido@python.org>
parents:
diff changeset
44
24752
c1eb668525e1 Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents: 19889
diff changeset
45 PyAPI_DATA(PyTypeObject) PyComplex_Type;
3316
e5d1f242daf9 complex numbers a la Konrad Hinsen
Guido van Rossum <guido@python.org>
parents:
diff changeset
46
19550
19d271f297dc Make the PyXXX_Check() macros for the numeric types inheritance-aware.
Guido van Rossum <guido@python.org>
parents: 13444
diff changeset
47 #define PyComplex_Check(op) PyObject_TypeCheck(op, &PyComplex_Type)
44351
86a2679dca46 #1629: Renamed Py_Size, Py_Type and Py_Refcnt to Py_SIZE, Py_TYPE and Py_REFCNT.
Christian Heimes <christian@cheimes.de>
parents: 42334
diff changeset
48 #define PyComplex_CheckExact(op) (Py_TYPE(op) == &PyComplex_Type)
3316
e5d1f242daf9 complex numbers a la Konrad Hinsen
Guido van Rossum <guido@python.org>
parents:
diff changeset
49
24752
c1eb668525e1 Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents: 19889
diff changeset
50 PyAPI_FUNC(PyObject *) PyComplex_FromCComplex(Py_complex);
c1eb668525e1 Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents: 19889
diff changeset
51 PyAPI_FUNC(PyObject *) PyComplex_FromDoubles(double real, double imag);
3316
e5d1f242daf9 complex numbers a la Konrad Hinsen
Guido van Rossum <guido@python.org>
parents:
diff changeset
52
24752
c1eb668525e1 Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents: 19889
diff changeset
53 PyAPI_FUNC(double) PyComplex_RealAsDouble(PyObject *op);
c1eb668525e1 Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents: 19889
diff changeset
54 PyAPI_FUNC(double) PyComplex_ImagAsDouble(PyObject *op);
c1eb668525e1 Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents: 19889
diff changeset
55 PyAPI_FUNC(Py_complex) PyComplex_AsCComplex(PyObject *op);
3316
e5d1f242daf9 complex numbers a la Konrad Hinsen
Guido van Rossum <guido@python.org>
parents:
diff changeset
56
53632
2cde0d003ffc Issue #1588: Add complex.__format__.
Eric Smith <eric@trueblade.com>
parents: 46477
diff changeset
57 /* Format the object based on the format_spec, as defined in PEP 3101
2cde0d003ffc Issue #1588: Add complex.__format__.
Eric Smith <eric@trueblade.com>
parents: 46477
diff changeset
58 (Advanced String Formatting). */
2cde0d003ffc Issue #1588: Add complex.__format__.
Eric Smith <eric@trueblade.com>
parents: 46477
diff changeset
59 PyAPI_FUNC(PyObject *) _PyComplex_FormatAdvanced(PyObject *obj,
2cde0d003ffc Issue #1588: Add complex.__format__.
Eric Smith <eric@trueblade.com>
parents: 46477
diff changeset
60 Py_UNICODE *format_spec,
2cde0d003ffc Issue #1588: Add complex.__format__.
Eric Smith <eric@trueblade.com>
parents: 46477
diff changeset
61 Py_ssize_t format_spec_len);
2cde0d003ffc Issue #1588: Add complex.__format__.
Eric Smith <eric@trueblade.com>
parents: 46477
diff changeset
62
3316
e5d1f242daf9 complex numbers a la Konrad Hinsen
Guido van Rossum <guido@python.org>
parents:
diff changeset
63 #ifdef __cplusplus
e5d1f242daf9 complex numbers a la Konrad Hinsen
Guido van Rossum <guido@python.org>
parents:
diff changeset
64 }
e5d1f242daf9 complex numbers a la Konrad Hinsen
Guido van Rossum <guido@python.org>
parents:
diff changeset
65 #endif
25554
36124157b317 SF # 607253, header file problems by Ralf W. Grosse-Kunstleve
Neal Norwitz <nnorwitz@gmail.com>
parents: 24752
diff changeset
66 #endif /* !Py_COMPLEXOBJECT_H */