annotate Objects/boolobject.c @ 49961:e793fc3c8abe

More 3.0 -> 3.1 transistion in the Windows and OS/2 build files
author Christian Heimes <christian@cheimes.de>
date Thu, 04 Dec 2008 14:27:25 +0000
parents 48c5eb513370
children af02b6e42142
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
22787
028ebc8fb390 Oops. Here are the new files. My apologies.
Guido van Rossum <guido@python.org>
parents:
diff changeset
1 /* Boolean type, a subtype of int */
028ebc8fb390 Oops. Here are the new files. My apologies.
Guido van Rossum <guido@python.org>
parents:
diff changeset
2
028ebc8fb390 Oops. Here are the new files. My apologies.
Guido van Rossum <guido@python.org>
parents:
diff changeset
3 #include "Python.h"
40626
4aee3f672f77 Merged the int/long unification branch, by very crude means (sorry Thomas!).
Guido van Rossum <guido@python.org>
parents: 40401
diff changeset
4 #include "longintrepr.h"
22787
028ebc8fb390 Oops. Here are the new files. My apologies.
Guido van Rossum <guido@python.org>
parents:
diff changeset
5
028ebc8fb390 Oops. Here are the new files. My apologies.
Guido van Rossum <guido@python.org>
parents:
diff changeset
6 /* We define bool_repr to return "False" or "True" */
028ebc8fb390 Oops. Here are the new files. My apologies.
Guido van Rossum <guido@python.org>
parents:
diff changeset
7
028ebc8fb390 Oops. Here are the new files. My apologies.
Guido van Rossum <guido@python.org>
parents:
diff changeset
8 static PyObject *false_str = NULL;
028ebc8fb390 Oops. Here are the new files. My apologies.
Guido van Rossum <guido@python.org>
parents:
diff changeset
9 static PyObject *true_str = NULL;
028ebc8fb390 Oops. Here are the new files. My apologies.
Guido van Rossum <guido@python.org>
parents:
diff changeset
10
24616
35dba6007ac3 Make more functions static
Neal Norwitz <nnorwitz@gmail.com>
parents: 23832
diff changeset
11 static PyObject *
40626
4aee3f672f77 Merged the int/long unification branch, by very crude means (sorry Thomas!).
Guido van Rossum <guido@python.org>
parents: 40401
diff changeset
12 bool_repr(PyObject *self)
22787
028ebc8fb390 Oops. Here are the new files. My apologies.
Guido van Rossum <guido@python.org>
parents:
diff changeset
13 {
028ebc8fb390 Oops. Here are the new files. My apologies.
Guido van Rossum <guido@python.org>
parents:
diff changeset
14 PyObject *s;
028ebc8fb390 Oops. Here are the new files. My apologies.
Guido van Rossum <guido@python.org>
parents:
diff changeset
15
40626
4aee3f672f77 Merged the int/long unification branch, by very crude means (sorry Thomas!).
Guido van Rossum <guido@python.org>
parents: 40401
diff changeset
16 if (self == Py_True)
22787
028ebc8fb390 Oops. Here are the new files. My apologies.
Guido van Rossum <guido@python.org>
parents:
diff changeset
17 s = true_str ? true_str :
41876
dcb43f40390b Add interning of unicode strings by copying the functionality from
Walter Dörwald <walter@livinglogic.de>
parents: 41769
diff changeset
18 (true_str = PyUnicode_InternFromString("True"));
22787
028ebc8fb390 Oops. Here are the new files. My apologies.
Guido van Rossum <guido@python.org>
parents:
diff changeset
19 else
028ebc8fb390 Oops. Here are the new files. My apologies.
Guido van Rossum <guido@python.org>
parents:
diff changeset
20 s = false_str ? false_str :
41876
dcb43f40390b Add interning of unicode strings by copying the functionality from
Walter Dörwald <walter@livinglogic.de>
parents: 41769
diff changeset
21 (false_str = PyUnicode_InternFromString("False"));
22787
028ebc8fb390 Oops. Here are the new files. My apologies.
Guido van Rossum <guido@python.org>
parents:
diff changeset
22 Py_XINCREF(s);
028ebc8fb390 Oops. Here are the new files. My apologies.
Guido van Rossum <guido@python.org>
parents:
diff changeset
23 return s;
028ebc8fb390 Oops. Here are the new files. My apologies.
Guido van Rossum <guido@python.org>
parents:
diff changeset
24 }
028ebc8fb390 Oops. Here are the new files. My apologies.
Guido van Rossum <guido@python.org>
parents:
diff changeset
25
028ebc8fb390 Oops. Here are the new files. My apologies.
Guido van Rossum <guido@python.org>
parents:
diff changeset
26 /* Function to return a bool from a C long */
028ebc8fb390 Oops. Here are the new files. My apologies.
Guido van Rossum <guido@python.org>
parents:
diff changeset
27
028ebc8fb390 Oops. Here are the new files. My apologies.
Guido van Rossum <guido@python.org>
parents:
diff changeset
28 PyObject *PyBool_FromLong(long ok)
028ebc8fb390 Oops. Here are the new files. My apologies.
Guido van Rossum <guido@python.org>
parents:
diff changeset
29 {
028ebc8fb390 Oops. Here are the new files. My apologies.
Guido van Rossum <guido@python.org>
parents:
diff changeset
30 PyObject *result;
028ebc8fb390 Oops. Here are the new files. My apologies.
Guido van Rossum <guido@python.org>
parents:
diff changeset
31
028ebc8fb390 Oops. Here are the new files. My apologies.
Guido van Rossum <guido@python.org>
parents:
diff changeset
32 if (ok)
028ebc8fb390 Oops. Here are the new files. My apologies.
Guido van Rossum <guido@python.org>
parents:
diff changeset
33 result = Py_True;
028ebc8fb390 Oops. Here are the new files. My apologies.
Guido van Rossum <guido@python.org>
parents:
diff changeset
34 else
028ebc8fb390 Oops. Here are the new files. My apologies.
Guido van Rossum <guido@python.org>
parents:
diff changeset
35 result = Py_False;
028ebc8fb390 Oops. Here are the new files. My apologies.
Guido van Rossum <guido@python.org>
parents:
diff changeset
36 Py_INCREF(result);
028ebc8fb390 Oops. Here are the new files. My apologies.
Guido van Rossum <guido@python.org>
parents:
diff changeset
37 return result;
028ebc8fb390 Oops. Here are the new files. My apologies.
Guido van Rossum <guido@python.org>
parents:
diff changeset
38 }
028ebc8fb390 Oops. Here are the new files. My apologies.
Guido van Rossum <guido@python.org>
parents:
diff changeset
39
028ebc8fb390 Oops. Here are the new files. My apologies.
Guido van Rossum <guido@python.org>
parents:
diff changeset
40 /* We define bool_new to always return either Py_True or Py_False */
028ebc8fb390 Oops. Here are the new files. My apologies.
Guido van Rossum <guido@python.org>
parents:
diff changeset
41
24616
35dba6007ac3 Make more functions static
Neal Norwitz <nnorwitz@gmail.com>
parents: 23832
diff changeset
42 static PyObject *
22787
028ebc8fb390 Oops. Here are the new files. My apologies.
Guido van Rossum <guido@python.org>
parents:
diff changeset
43 bool_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
028ebc8fb390 Oops. Here are the new files. My apologies.
Guido van Rossum <guido@python.org>
parents:
diff changeset
44 {
36675
dba6494735d0 Revert backwards-incompatible const changes.
Martin v. Löwis <martin@v.loewis.de>
parents: 35999
diff changeset
45 static char *kwlist[] = {"x", 0};
28696
658b10c5ba2a - bool() called without arguments now returns False rather than
Guido van Rossum <guido@python.org>
parents: 24616
diff changeset
46 PyObject *x = Py_False;
22787
028ebc8fb390 Oops. Here are the new files. My apologies.
Guido van Rossum <guido@python.org>
parents:
diff changeset
47 long ok;
028ebc8fb390 Oops. Here are the new files. My apologies.
Guido van Rossum <guido@python.org>
parents:
diff changeset
48
28696
658b10c5ba2a - bool() called without arguments now returns False rather than
Guido van Rossum <guido@python.org>
parents: 24616
diff changeset
49 if (!PyArg_ParseTupleAndKeywords(args, kwds, "|O:bool", kwlist, &x))
22787
028ebc8fb390 Oops. Here are the new files. My apologies.
Guido van Rossum <guido@python.org>
parents:
diff changeset
50 return NULL;
028ebc8fb390 Oops. Here are the new files. My apologies.
Guido van Rossum <guido@python.org>
parents:
diff changeset
51 ok = PyObject_IsTrue(x);
028ebc8fb390 Oops. Here are the new files. My apologies.
Guido van Rossum <guido@python.org>
parents:
diff changeset
52 if (ok < 0)
028ebc8fb390 Oops. Here are the new files. My apologies.
Guido van Rossum <guido@python.org>
parents:
diff changeset
53 return NULL;
028ebc8fb390 Oops. Here are the new files. My apologies.
Guido van Rossum <guido@python.org>
parents:
diff changeset
54 return PyBool_FromLong(ok);
028ebc8fb390 Oops. Here are the new files. My apologies.
Guido van Rossum <guido@python.org>
parents:
diff changeset
55 }
028ebc8fb390 Oops. Here are the new files. My apologies.
Guido van Rossum <guido@python.org>
parents:
diff changeset
56
028ebc8fb390 Oops. Here are the new files. My apologies.
Guido van Rossum <guido@python.org>
parents:
diff changeset
57 /* Arithmetic operations redefined to return bool if both args are bool. */
028ebc8fb390 Oops. Here are the new files. My apologies.
Guido van Rossum <guido@python.org>
parents:
diff changeset
58
028ebc8fb390 Oops. Here are the new files. My apologies.
Guido van Rossum <guido@python.org>
parents:
diff changeset
59 static PyObject *
028ebc8fb390 Oops. Here are the new files. My apologies.
Guido van Rossum <guido@python.org>
parents:
diff changeset
60 bool_and(PyObject *a, PyObject *b)
028ebc8fb390 Oops. Here are the new files. My apologies.
Guido van Rossum <guido@python.org>
parents:
diff changeset
61 {
028ebc8fb390 Oops. Here are the new files. My apologies.
Guido van Rossum <guido@python.org>
parents:
diff changeset
62 if (!PyBool_Check(a) || !PyBool_Check(b))
40626
4aee3f672f77 Merged the int/long unification branch, by very crude means (sorry Thomas!).
Guido van Rossum <guido@python.org>
parents: 40401
diff changeset
63 return PyLong_Type.tp_as_number->nb_and(a, b);
4aee3f672f77 Merged the int/long unification branch, by very crude means (sorry Thomas!).
Guido van Rossum <guido@python.org>
parents: 40401
diff changeset
64 return PyBool_FromLong((a == Py_True) & (b == Py_True));
22787
028ebc8fb390 Oops. Here are the new files. My apologies.
Guido van Rossum <guido@python.org>
parents:
diff changeset
65 }
028ebc8fb390 Oops. Here are the new files. My apologies.
Guido van Rossum <guido@python.org>
parents:
diff changeset
66
028ebc8fb390 Oops. Here are the new files. My apologies.
Guido van Rossum <guido@python.org>
parents:
diff changeset
67 static PyObject *
028ebc8fb390 Oops. Here are the new files. My apologies.
Guido van Rossum <guido@python.org>
parents:
diff changeset
68 bool_or(PyObject *a, PyObject *b)
028ebc8fb390 Oops. Here are the new files. My apologies.
Guido van Rossum <guido@python.org>
parents:
diff changeset
69 {
028ebc8fb390 Oops. Here are the new files. My apologies.
Guido van Rossum <guido@python.org>
parents:
diff changeset
70 if (!PyBool_Check(a) || !PyBool_Check(b))
40626
4aee3f672f77 Merged the int/long unification branch, by very crude means (sorry Thomas!).
Guido van Rossum <guido@python.org>
parents: 40401
diff changeset
71 return PyLong_Type.tp_as_number->nb_or(a, b);
4aee3f672f77 Merged the int/long unification branch, by very crude means (sorry Thomas!).
Guido van Rossum <guido@python.org>
parents: 40401
diff changeset
72 return PyBool_FromLong((a == Py_True) | (b == Py_True));
22787
028ebc8fb390 Oops. Here are the new files. My apologies.
Guido van Rossum <guido@python.org>
parents:
diff changeset
73 }
028ebc8fb390 Oops. Here are the new files. My apologies.
Guido van Rossum <guido@python.org>
parents:
diff changeset
74
028ebc8fb390 Oops. Here are the new files. My apologies.
Guido van Rossum <guido@python.org>
parents:
diff changeset
75 static PyObject *
028ebc8fb390 Oops. Here are the new files. My apologies.
Guido van Rossum <guido@python.org>
parents:
diff changeset
76 bool_xor(PyObject *a, PyObject *b)
028ebc8fb390 Oops. Here are the new files. My apologies.
Guido van Rossum <guido@python.org>
parents:
diff changeset
77 {
028ebc8fb390 Oops. Here are the new files. My apologies.
Guido van Rossum <guido@python.org>
parents:
diff changeset
78 if (!PyBool_Check(a) || !PyBool_Check(b))
40626
4aee3f672f77 Merged the int/long unification branch, by very crude means (sorry Thomas!).
Guido van Rossum <guido@python.org>
parents: 40401
diff changeset
79 return PyLong_Type.tp_as_number->nb_xor(a, b);
4aee3f672f77 Merged the int/long unification branch, by very crude means (sorry Thomas!).
Guido van Rossum <guido@python.org>
parents: 40401
diff changeset
80 return PyBool_FromLong((a == Py_True) ^ (b == Py_True));
22787
028ebc8fb390 Oops. Here are the new files. My apologies.
Guido van Rossum <guido@python.org>
parents:
diff changeset
81 }
028ebc8fb390 Oops. Here are the new files. My apologies.
Guido van Rossum <guido@python.org>
parents:
diff changeset
82
028ebc8fb390 Oops. Here are the new files. My apologies.
Guido van Rossum <guido@python.org>
parents:
diff changeset
83 /* Doc string */
028ebc8fb390 Oops. Here are the new files. My apologies.
Guido van Rossum <guido@python.org>
parents:
diff changeset
84
23832
ed1ba37a46b7 Patch #568124: Add doc string macros.
Martin v. Löwis <martin@v.loewis.de>
parents: 23276
diff changeset
85 PyDoc_STRVAR(bool_doc,
22787
028ebc8fb390 Oops. Here are the new files. My apologies.
Guido van Rossum <guido@python.org>
parents:
diff changeset
86 "bool(x) -> bool\n\
028ebc8fb390 Oops. Here are the new files. My apologies.
Guido van Rossum <guido@python.org>
parents:
diff changeset
87 \n\
028ebc8fb390 Oops. Here are the new files. My apologies.
Guido van Rossum <guido@python.org>
parents:
diff changeset
88 Returns True when the argument x is true, False otherwise.\n\
028ebc8fb390 Oops. Here are the new files. My apologies.
Guido van Rossum <guido@python.org>
parents:
diff changeset
89 The builtins True and False are the only two instances of the class bool.\n\
23832
ed1ba37a46b7 Patch #568124: Add doc string macros.
Martin v. Löwis <martin@v.loewis.de>
parents: 23276
diff changeset
90 The class bool is a subclass of the class int, and cannot be subclassed.");
22787
028ebc8fb390 Oops. Here are the new files. My apologies.
Guido van Rossum <guido@python.org>
parents:
diff changeset
91
028ebc8fb390 Oops. Here are the new files. My apologies.
Guido van Rossum <guido@python.org>
parents:
diff changeset
92 /* Arithmetic methods -- only so we can override &, |, ^. */
028ebc8fb390 Oops. Here are the new files. My apologies.
Guido van Rossum <guido@python.org>
parents:
diff changeset
93
028ebc8fb390 Oops. Here are the new files. My apologies.
Guido van Rossum <guido@python.org>
parents:
diff changeset
94 static PyNumberMethods bool_as_number = {
37879
f731859e9b3b Merge p3yk branch with the trunk up to revision 45595. This breaks a fair
Thomas Wouters <thomas@python.org>
parents: 37191
diff changeset
95 0, /* nb_add */
f731859e9b3b Merge p3yk branch with the trunk up to revision 45595. This breaks a fair
Thomas Wouters <thomas@python.org>
parents: 37191
diff changeset
96 0, /* nb_subtract */
f731859e9b3b Merge p3yk branch with the trunk up to revision 45595. This breaks a fair
Thomas Wouters <thomas@python.org>
parents: 37191
diff changeset
97 0, /* nb_multiply */
f731859e9b3b Merge p3yk branch with the trunk up to revision 45595. This breaks a fair
Thomas Wouters <thomas@python.org>
parents: 37191
diff changeset
98 0, /* nb_remainder */
f731859e9b3b Merge p3yk branch with the trunk up to revision 45595. This breaks a fair
Thomas Wouters <thomas@python.org>
parents: 37191
diff changeset
99 0, /* nb_divmod */
f731859e9b3b Merge p3yk branch with the trunk up to revision 45595. This breaks a fair
Thomas Wouters <thomas@python.org>
parents: 37191
diff changeset
100 0, /* nb_power */
f731859e9b3b Merge p3yk branch with the trunk up to revision 45595. This breaks a fair
Thomas Wouters <thomas@python.org>
parents: 37191
diff changeset
101 0, /* nb_negative */
f731859e9b3b Merge p3yk branch with the trunk up to revision 45595. This breaks a fair
Thomas Wouters <thomas@python.org>
parents: 37191
diff changeset
102 0, /* nb_positive */
f731859e9b3b Merge p3yk branch with the trunk up to revision 45595. This breaks a fair
Thomas Wouters <thomas@python.org>
parents: 37191
diff changeset
103 0, /* nb_absolute */
40401
88133417dfd0 - patch #1600346 submitted by Tomer Filiba
Jack Diederich <jackdied@gmail.com>
parents: 39222
diff changeset
104 0, /* nb_bool */
37879
f731859e9b3b Merge p3yk branch with the trunk up to revision 45595. This breaks a fair
Thomas Wouters <thomas@python.org>
parents: 37191
diff changeset
105 0, /* nb_invert */
f731859e9b3b Merge p3yk branch with the trunk up to revision 45595. This breaks a fair
Thomas Wouters <thomas@python.org>
parents: 37191
diff changeset
106 0, /* nb_lshift */
f731859e9b3b Merge p3yk branch with the trunk up to revision 45595. This breaks a fair
Thomas Wouters <thomas@python.org>
parents: 37191
diff changeset
107 0, /* nb_rshift */
f731859e9b3b Merge p3yk branch with the trunk up to revision 45595. This breaks a fair
Thomas Wouters <thomas@python.org>
parents: 37191
diff changeset
108 bool_and, /* nb_and */
f731859e9b3b Merge p3yk branch with the trunk up to revision 45595. This breaks a fair
Thomas Wouters <thomas@python.org>
parents: 37191
diff changeset
109 bool_xor, /* nb_xor */
f731859e9b3b Merge p3yk branch with the trunk up to revision 45595. This breaks a fair
Thomas Wouters <thomas@python.org>
parents: 37191
diff changeset
110 bool_or, /* nb_or */
f731859e9b3b Merge p3yk branch with the trunk up to revision 45595. This breaks a fair
Thomas Wouters <thomas@python.org>
parents: 37191
diff changeset
111 0, /* nb_int */
f731859e9b3b Merge p3yk branch with the trunk up to revision 45595. This breaks a fair
Thomas Wouters <thomas@python.org>
parents: 37191
diff changeset
112 0, /* nb_long */
f731859e9b3b Merge p3yk branch with the trunk up to revision 45595. This breaks a fair
Thomas Wouters <thomas@python.org>
parents: 37191
diff changeset
113 0, /* nb_float */
f731859e9b3b Merge p3yk branch with the trunk up to revision 45595. This breaks a fair
Thomas Wouters <thomas@python.org>
parents: 37191
diff changeset
114 0, /* nb_inplace_add */
f731859e9b3b Merge p3yk branch with the trunk up to revision 45595. This breaks a fair
Thomas Wouters <thomas@python.org>
parents: 37191
diff changeset
115 0, /* nb_inplace_subtract */
f731859e9b3b Merge p3yk branch with the trunk up to revision 45595. This breaks a fair
Thomas Wouters <thomas@python.org>
parents: 37191
diff changeset
116 0, /* nb_inplace_multiply */
f731859e9b3b Merge p3yk branch with the trunk up to revision 45595. This breaks a fair
Thomas Wouters <thomas@python.org>
parents: 37191
diff changeset
117 0, /* nb_inplace_remainder */
f731859e9b3b Merge p3yk branch with the trunk up to revision 45595. This breaks a fair
Thomas Wouters <thomas@python.org>
parents: 37191
diff changeset
118 0, /* nb_inplace_power */
f731859e9b3b Merge p3yk branch with the trunk up to revision 45595. This breaks a fair
Thomas Wouters <thomas@python.org>
parents: 37191
diff changeset
119 0, /* nb_inplace_lshift */
f731859e9b3b Merge p3yk branch with the trunk up to revision 45595. This breaks a fair
Thomas Wouters <thomas@python.org>
parents: 37191
diff changeset
120 0, /* nb_inplace_rshift */
f731859e9b3b Merge p3yk branch with the trunk up to revision 45595. This breaks a fair
Thomas Wouters <thomas@python.org>
parents: 37191
diff changeset
121 0, /* nb_inplace_and */
f731859e9b3b Merge p3yk branch with the trunk up to revision 45595. This breaks a fair
Thomas Wouters <thomas@python.org>
parents: 37191
diff changeset
122 0, /* nb_inplace_xor */
f731859e9b3b Merge p3yk branch with the trunk up to revision 45595. This breaks a fair
Thomas Wouters <thomas@python.org>
parents: 37191
diff changeset
123 0, /* nb_inplace_or */
f731859e9b3b Merge p3yk branch with the trunk up to revision 45595. This breaks a fair
Thomas Wouters <thomas@python.org>
parents: 37191
diff changeset
124 0, /* nb_floor_divide */
f731859e9b3b Merge p3yk branch with the trunk up to revision 45595. This breaks a fair
Thomas Wouters <thomas@python.org>
parents: 37191
diff changeset
125 0, /* nb_true_divide */
f731859e9b3b Merge p3yk branch with the trunk up to revision 45595. This breaks a fair
Thomas Wouters <thomas@python.org>
parents: 37191
diff changeset
126 0, /* nb_inplace_floor_divide */
f731859e9b3b Merge p3yk branch with the trunk up to revision 45595. This breaks a fair
Thomas Wouters <thomas@python.org>
parents: 37191
diff changeset
127 0, /* nb_inplace_true_divide */
40626
4aee3f672f77 Merged the int/long unification branch, by very crude means (sorry Thomas!).
Guido van Rossum <guido@python.org>
parents: 40401
diff changeset
128 0, /* nb_index */
22787
028ebc8fb390 Oops. Here are the new files. My apologies.
Guido van Rossum <guido@python.org>
parents:
diff changeset
129 };
028ebc8fb390 Oops. Here are the new files. My apologies.
Guido van Rossum <guido@python.org>
parents:
diff changeset
130
028ebc8fb390 Oops. Here are the new files. My apologies.
Guido van Rossum <guido@python.org>
parents:
diff changeset
131 /* The type object for bool. Note that this cannot be subclassed! */
028ebc8fb390 Oops. Here are the new files. My apologies.
Guido van Rossum <guido@python.org>
parents:
diff changeset
132
028ebc8fb390 Oops. Here are the new files. My apologies.
Guido van Rossum <guido@python.org>
parents:
diff changeset
133 PyTypeObject PyBool_Type = {
42334
e70cdce0e8b2 Merged revisions 56467-56482 via svnmerge from
Martin v. Löwis <martin@v.loewis.de>
parents: 41876
diff changeset
134 PyVarObject_HEAD_INIT(&PyType_Type, 0)
22787
028ebc8fb390 Oops. Here are the new files. My apologies.
Guido van Rossum <guido@python.org>
parents:
diff changeset
135 "bool",
40626
4aee3f672f77 Merged the int/long unification branch, by very crude means (sorry Thomas!).
Guido van Rossum <guido@python.org>
parents: 40401
diff changeset
136 sizeof(struct _longobject),
22787
028ebc8fb390 Oops. Here are the new files. My apologies.
Guido van Rossum <guido@python.org>
parents:
diff changeset
137 0,
028ebc8fb390 Oops. Here are the new files. My apologies.
Guido van Rossum <guido@python.org>
parents:
diff changeset
138 0, /* tp_dealloc */
42477
e7fd327e0c19 Kill all uses and definitions of tp_print under Objects/. (Others will follow.)
Guido van Rossum <guido@python.org>
parents: 42334
diff changeset
139 0, /* tp_print */
22787
028ebc8fb390 Oops. Here are the new files. My apologies.
Guido van Rossum <guido@python.org>
parents:
diff changeset
140 0, /* tp_getattr */
028ebc8fb390 Oops. Here are the new files. My apologies.
Guido van Rossum <guido@python.org>
parents:
diff changeset
141 0, /* tp_setattr */
028ebc8fb390 Oops. Here are the new files. My apologies.
Guido van Rossum <guido@python.org>
parents:
diff changeset
142 0, /* tp_compare */
40626
4aee3f672f77 Merged the int/long unification branch, by very crude means (sorry Thomas!).
Guido van Rossum <guido@python.org>
parents: 40401
diff changeset
143 bool_repr, /* tp_repr */
22787
028ebc8fb390 Oops. Here are the new files. My apologies.
Guido van Rossum <guido@python.org>
parents:
diff changeset
144 &bool_as_number, /* tp_as_number */
028ebc8fb390 Oops. Here are the new files. My apologies.
Guido van Rossum <guido@python.org>
parents:
diff changeset
145 0, /* tp_as_sequence */
028ebc8fb390 Oops. Here are the new files. My apologies.
Guido van Rossum <guido@python.org>
parents:
diff changeset
146 0, /* tp_as_mapping */
028ebc8fb390 Oops. Here are the new files. My apologies.
Guido van Rossum <guido@python.org>
parents:
diff changeset
147 0, /* tp_hash */
028ebc8fb390 Oops. Here are the new files. My apologies.
Guido van Rossum <guido@python.org>
parents:
diff changeset
148 0, /* tp_call */
40626
4aee3f672f77 Merged the int/long unification branch, by very crude means (sorry Thomas!).
Guido van Rossum <guido@python.org>
parents: 40401
diff changeset
149 bool_repr, /* tp_str */
22787
028ebc8fb390 Oops. Here are the new files. My apologies.
Guido van Rossum <guido@python.org>
parents:
diff changeset
150 0, /* tp_getattro */
028ebc8fb390 Oops. Here are the new files. My apologies.
Guido van Rossum <guido@python.org>
parents:
diff changeset
151 0, /* tp_setattro */
028ebc8fb390 Oops. Here are the new files. My apologies.
Guido van Rossum <guido@python.org>
parents:
diff changeset
152 0, /* tp_as_buffer */
39222
b0cdcbcc5f45 Get rid of most of the flags (in tp_flags) that keep track of various
Guido van Rossum <guido@python.org>
parents: 37879
diff changeset
153 Py_TPFLAGS_DEFAULT, /* tp_flags */
22787
028ebc8fb390 Oops. Here are the new files. My apologies.
Guido van Rossum <guido@python.org>
parents:
diff changeset
154 bool_doc, /* tp_doc */
028ebc8fb390 Oops. Here are the new files. My apologies.
Guido van Rossum <guido@python.org>
parents:
diff changeset
155 0, /* tp_traverse */
028ebc8fb390 Oops. Here are the new files. My apologies.
Guido van Rossum <guido@python.org>
parents:
diff changeset
156 0, /* tp_clear */
028ebc8fb390 Oops. Here are the new files. My apologies.
Guido van Rossum <guido@python.org>
parents:
diff changeset
157 0, /* tp_richcompare */
028ebc8fb390 Oops. Here are the new files. My apologies.
Guido van Rossum <guido@python.org>
parents:
diff changeset
158 0, /* tp_weaklistoffset */
028ebc8fb390 Oops. Here are the new files. My apologies.
Guido van Rossum <guido@python.org>
parents:
diff changeset
159 0, /* tp_iter */
028ebc8fb390 Oops. Here are the new files. My apologies.
Guido van Rossum <guido@python.org>
parents:
diff changeset
160 0, /* tp_iternext */
028ebc8fb390 Oops. Here are the new files. My apologies.
Guido van Rossum <guido@python.org>
parents:
diff changeset
161 0, /* tp_methods */
028ebc8fb390 Oops. Here are the new files. My apologies.
Guido van Rossum <guido@python.org>
parents:
diff changeset
162 0, /* tp_members */
028ebc8fb390 Oops. Here are the new files. My apologies.
Guido van Rossum <guido@python.org>
parents:
diff changeset
163 0, /* tp_getset */
40626
4aee3f672f77 Merged the int/long unification branch, by very crude means (sorry Thomas!).
Guido van Rossum <guido@python.org>
parents: 40401
diff changeset
164 &PyLong_Type, /* tp_base */
22787
028ebc8fb390 Oops. Here are the new files. My apologies.
Guido van Rossum <guido@python.org>
parents:
diff changeset
165 0, /* tp_dict */
028ebc8fb390 Oops. Here are the new files. My apologies.
Guido van Rossum <guido@python.org>
parents:
diff changeset
166 0, /* tp_descr_get */
028ebc8fb390 Oops. Here are the new files. My apologies.
Guido van Rossum <guido@python.org>
parents:
diff changeset
167 0, /* tp_descr_set */
028ebc8fb390 Oops. Here are the new files. My apologies.
Guido van Rossum <guido@python.org>
parents:
diff changeset
168 0, /* tp_dictoffset */
028ebc8fb390 Oops. Here are the new files. My apologies.
Guido van Rossum <guido@python.org>
parents:
diff changeset
169 0, /* tp_init */
028ebc8fb390 Oops. Here are the new files. My apologies.
Guido van Rossum <guido@python.org>
parents:
diff changeset
170 0, /* tp_alloc */
028ebc8fb390 Oops. Here are the new files. My apologies.
Guido van Rossum <guido@python.org>
parents:
diff changeset
171 bool_new, /* tp_new */
028ebc8fb390 Oops. Here are the new files. My apologies.
Guido van Rossum <guido@python.org>
parents:
diff changeset
172 };
028ebc8fb390 Oops. Here are the new files. My apologies.
Guido van Rossum <guido@python.org>
parents:
diff changeset
173
028ebc8fb390 Oops. Here are the new files. My apologies.
Guido van Rossum <guido@python.org>
parents:
diff changeset
174 /* The objects representing bool values False and True */
028ebc8fb390 Oops. Here are the new files. My apologies.
Guido van Rossum <guido@python.org>
parents:
diff changeset
175
40626
4aee3f672f77 Merged the int/long unification branch, by very crude means (sorry Thomas!).
Guido van Rossum <guido@python.org>
parents: 40401
diff changeset
176 struct _longobject _Py_FalseStruct = {
42334
e70cdce0e8b2 Merged revisions 56467-56482 via svnmerge from
Martin v. Löwis <martin@v.loewis.de>
parents: 41876
diff changeset
177 PyVarObject_HEAD_INIT(&PyBool_Type, 0)
e70cdce0e8b2 Merged revisions 56467-56482 via svnmerge from
Martin v. Löwis <martin@v.loewis.de>
parents: 41876
diff changeset
178 { 0 }
22787
028ebc8fb390 Oops. Here are the new files. My apologies.
Guido van Rossum <guido@python.org>
parents:
diff changeset
179 };
028ebc8fb390 Oops. Here are the new files. My apologies.
Guido van Rossum <guido@python.org>
parents:
diff changeset
180
40626
4aee3f672f77 Merged the int/long unification branch, by very crude means (sorry Thomas!).
Guido van Rossum <guido@python.org>
parents: 40401
diff changeset
181 struct _longobject _Py_TrueStruct = {
42334
e70cdce0e8b2 Merged revisions 56467-56482 via svnmerge from
Martin v. Löwis <martin@v.loewis.de>
parents: 41876
diff changeset
182 PyVarObject_HEAD_INIT(&PyBool_Type, 1)
e70cdce0e8b2 Merged revisions 56467-56482 via svnmerge from
Martin v. Löwis <martin@v.loewis.de>
parents: 41876
diff changeset
183 { 1 }
22787
028ebc8fb390 Oops. Here are the new files. My apologies.
Guido van Rossum <guido@python.org>
parents:
diff changeset
184 };