mirror of
https://github.com/python/cpython.git
synced 2025-11-25 21:11:09 +00:00
- 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
This commit is contained in:
parent
dfc9d4f7aa
commit
4dafcc4ece
31 changed files with 118 additions and 82 deletions
|
|
@ -568,7 +568,7 @@ complex_abs(PyComplexObject *v)
|
|||
}
|
||||
|
||||
static int
|
||||
complex_nonzero(PyComplexObject *v)
|
||||
complex_bool(PyComplexObject *v)
|
||||
{
|
||||
return v->cval.real != 0.0 || v->cval.imag != 0.0;
|
||||
}
|
||||
|
|
@ -938,7 +938,7 @@ static PyNumberMethods complex_as_number = {
|
|||
(unaryfunc)complex_neg, /* nb_negative */
|
||||
(unaryfunc)complex_pos, /* nb_positive */
|
||||
(unaryfunc)complex_abs, /* nb_absolute */
|
||||
(inquiry)complex_nonzero, /* nb_nonzero */
|
||||
(inquiry)complex_bool, /* nb_bool */
|
||||
0, /* nb_invert */
|
||||
0, /* nb_lshift */
|
||||
0, /* nb_rshift */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue