mirror of
https://github.com/pocketpy/pocketpy
synced 2025-10-20 11:30:18 +00:00
...
This commit is contained in:
parent
3cae7e6809
commit
b889acd896
@ -313,7 +313,8 @@ PyObject* VM::py_negate(PyObject* obj){
|
||||
}
|
||||
|
||||
bool VM::py_bool(PyObject* obj){
|
||||
if(is_non_tagged_type(obj, tp_bool)) return obj == True;
|
||||
if(obj == vm->True) return true;
|
||||
if(obj == vm->False) return false;
|
||||
if(obj == None) return false;
|
||||
if(is_int(obj)) return _CAST(i64, obj) != 0;
|
||||
if(is_float(obj)) return _CAST(f64, obj) != 0.0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user