mirror of
https://github.com/pybind/pybind11.git
synced 2025-03-02 06:42:45 +00: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…
Reference in New Issue
Block a user