mirror of
https://github.com/python/cpython.git
synced 2026-01-06 15:32:22 +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
|
|
@ -1246,8 +1246,8 @@ PyObject_IsTrue(PyObject *v)
|
|||
if (v == Py_None)
|
||||
return 0;
|
||||
else if (v->ob_type->tp_as_number != NULL &&
|
||||
v->ob_type->tp_as_number->nb_nonzero != NULL)
|
||||
res = (*v->ob_type->tp_as_number->nb_nonzero)(v);
|
||||
v->ob_type->tp_as_number->nb_bool != NULL)
|
||||
res = (*v->ob_type->tp_as_number->nb_bool)(v);
|
||||
else if (v->ob_type->tp_as_mapping != NULL &&
|
||||
v->ob_type->tp_as_mapping->mp_length != NULL)
|
||||
res = (*v->ob_type->tp_as_mapping->mp_length)(v);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue