Browse Source

interrogate: Use __bool__ for default name of operator bool

rdb 4 years ago
parent
commit
e4ecb548bf
1 changed files with 2 additions and 1 deletions
  1. 2 1
      dtool/src/interrogate/interfaceMakerPythonNative.cxx

+ 2 - 1
dtool/src/interrogate/interfaceMakerPythonNative.cxx

@@ -103,7 +103,8 @@ 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", "__bool__",       0 },
+  { "__bool__"      , "__bool__",               0 },
   { "__nonzero__"   , "__nonzero__",            0 },
   { "__nonzero__"   , "__nonzero__",            0 },
   { "__int__"       , "__int__",                0 },
   { "__int__"       , "__int__",                0 },
   { "__reduce__"    , "__reduce__",             0 },
   { "__reduce__"    , "__reduce__",             0 },