mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 18:31:55 -04:00
respect __nonzero__
This commit is contained in:
parent
9f9316ff81
commit
0e773c8684
@ -97,6 +97,7 @@ RenameSet methodRenameDictionary[] = {
|
|||||||
{ "operator <<=" , "__ilshift__", 1 },
|
{ "operator <<=" , "__ilshift__", 1 },
|
||||||
{ "operator >>=" , "__irshift__", 1 },
|
{ "operator >>=" , "__irshift__", 1 },
|
||||||
{ "operator typecast bool", "__nonzero__", 0 },
|
{ "operator typecast bool", "__nonzero__", 0 },
|
||||||
|
{ "__nonzero__" , "__nonzero__", 0 },
|
||||||
{ "print" , "Cprint", 0 },
|
{ "print" , "Cprint", 0 },
|
||||||
{ "CInterval.set_t", "_priv__cSetT", 0 },
|
{ "CInterval.set_t", "_priv__cSetT", 0 },
|
||||||
{ NULL, NULL, -1 }
|
{ NULL, NULL, -1 }
|
||||||
@ -558,6 +559,12 @@ get_slotted_function_def(Object *obj, Function *func, SlottedFunctionDef &def) {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (method_name == "__nonzero__") {
|
||||||
|
def._answer_location = "tp_as_number->nb_nonzero";
|
||||||
|
def._wrapper_type = WT_inquiry;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
if (func->_ifunc.is_operator_typecast()) {
|
if (func->_ifunc.is_operator_typecast()) {
|
||||||
// A typecast operator. Check for a supported low-level typecast type.
|
// A typecast operator. Check for a supported low-level typecast type.
|
||||||
if (!func->_remaps.empty()) {
|
if (!func->_remaps.empty()) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user