summaryrefslogtreecommitdiffstats
path: root/Objects/intobject.c
diff options
context:
space:
mode:
authorJack Diederich <jackdied@gmail.com>2006-11-28 19:15:13 (GMT)
committerJack Diederich <jackdied@gmail.com>2006-11-28 19:15:13 (GMT)
commit4dafcc4ece09c2a60473bb109513de4e7d2c2b11 (patch)
tree32be8af9dd16e1ea407bf008c92d62f7cd7539bd /Objects/intobject.c
parentdfc9d4f7aa38a3961847c034532e39f05a569f54 (diff)
downloadcpython-4dafcc4ece09c2a60473bb109513de4e7d2c2b11.zip
cpython-4dafcc4ece09c2a60473bb109513de4e7d2c2b11.tar.gz
cpython-4dafcc4ece09c2a60473bb109513de4e7d2c2b11.tar.bz2
- patch #1600346 submitted by Tomer Filiba
- Renamed nb_nonzero slots to nb_bool - Renamed __nonzero__ methods to __bool__ - update core, lib, docs, and tests to match
Diffstat (limited to 'Objects/intobject.c')
-rw-r--r--Objects/intobject.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/Objects/intobject.c b/Objects/intobject.c
index e64d0b1..b420c12 100644
--- a/Objects/intobject.c
+++ b/Objects/intobject.c
@@ -780,7 +780,7 @@ int_abs(PyIntObject *v)
}
static int
-int_nonzero(PyIntObject *v)
+int_bool(PyIntObject *v)
{
return v->ob_ival != 0;
}
@@ -1034,14 +1034,14 @@ static PyNumberMethods int_as_number = {
(unaryfunc)int_neg, /*nb_negative*/
(unaryfunc)int_pos, /*nb_positive*/
(unaryfunc)int_abs, /*nb_absolute*/
- (inquiry)int_nonzero, /*nb_nonzero*/
+ (inquiry)int_bool, /*nb_bool*/
(unaryfunc)int_invert, /*nb_invert*/
(binaryfunc)int_lshift, /*nb_lshift*/
(binaryfunc)int_rshift, /*nb_rshift*/
(binaryfunc)int_and, /*nb_and*/
(binaryfunc)int_xor, /*nb_xor*/
(binaryfunc)int_or, /*nb_or*/
- 0, /*nb_coerce*/
+ 0, /*nb_coerce*/
(unaryfunc)int_int, /*nb_int*/
(unaryfunc)int_long, /*nb_long*/
(unaryfunc)int_float, /*nb_float*/