mirror of
https://github.com/RYDE-WORK/pybind11.git
synced 2026-01-30 19:23:12 +08:00
support __bool__ on Python 2.x and 3.x
This commit is contained in:
parent
00c7d6ccc7
commit
d1bfc4e0f8
@ -200,6 +200,9 @@ protected:
|
|||||||
if (strcmp(rec->name, "__next__") == 0) {
|
if (strcmp(rec->name, "__next__") == 0) {
|
||||||
std::free(rec->name);
|
std::free(rec->name);
|
||||||
rec->name = strdup("next");
|
rec->name = strdup("next");
|
||||||
|
} else if (strcmp(rec->name, "__bool__") == 0) {
|
||||||
|
std::free(rec->name);
|
||||||
|
rec->name = strdup("__nonzero__");
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user