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
@ -67,14 +67,14 @@ RenameSet methodRenameDictionary[] = {
|
|||||||
{ "operator =" , "assign", 0 },
|
{ "operator =" , "assign", 0 },
|
||||||
{ "operator ()" , "__call__", 0 },
|
{ "operator ()" , "__call__", 0 },
|
||||||
{ "operator []" , "__getitem__", 0 },
|
{ "operator []" , "__getitem__", 0 },
|
||||||
{ "operator ++unary" , "increment", 0 },
|
{ "operator ++unary", "increment", 0 },
|
||||||
{ "operator ++" , "increment", 0 },
|
{ "operator ++" , "increment", 0 },
|
||||||
{ "operator --unary" , "decrement", 0 },
|
{ "operator --unary", "decrement", 0 },
|
||||||
{ "operator --" , "decrement", 0 },
|
{ "operator --" , "decrement", 0 },
|
||||||
{ "operator ^" , "__xor__", 0 },
|
{ "operator ^" , "__xor__", 0 },
|
||||||
{ "operator %" , "__mod__", 0 },
|
{ "operator %" , "__mod__", 0 },
|
||||||
{ "operator !" , "logicalNot", 0 },
|
{ "operator !" , "logicalNot", 0 },
|
||||||
{ "operator ~unary" , "__invert__", 0 },
|
{ "operator ~unary", "__invert__", 0 },
|
||||||
{ "operator &" , "__and__", 0 },
|
{ "operator &" , "__and__", 0 },
|
||||||
{ "operator &&" , "logicalAnd", 0 },
|
{ "operator &&" , "logicalAnd", 0 },
|
||||||
{ "operator |" , "__or__", 0 },
|
{ "operator |" , "__or__", 0 },
|
||||||
@ -96,9 +96,10 @@ RenameSet methodRenameDictionary[] = {
|
|||||||
{ "operator ->" , "dereference", 0 },
|
{ "operator ->" , "dereference", 0 },
|
||||||
{ "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