diff options
author | Jack Diederich <jackdied@gmail.com> | 2006-11-28 19:15:13 +0000 |
---|---|---|
committer | Jack Diederich <jackdied@gmail.com> | 2006-11-28 19:15:13 +0000 |
commit | f53f3528c31c9e268b3a78be13fd95b00551730e (patch) | |
tree | d5a99a34564d567a34af81bb82e389a8f8687937 /Objects/intobject.c | |
parent | d4808d0fe6d4588f222fd253794644d522f66e55 (diff) | |
download | cpython-f53f3528c31c9e268b3a78be13fd95b00551730e.tar.gz |
- 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.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Objects/intobject.c b/Objects/intobject.c index e64d0b1f9a..b420c128bd 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*/ |