This commit is contained in:
blueloveTH 2024-08-12 13:38:29 +08:00
parent b01234d27e
commit a5725824b4
2 changed files with 1 additions and 4 deletions

View File

@ -203,7 +203,7 @@ void* py_touserdata(py_Ref);
/// Get the type of the object. /// Get the type of the object.
py_Type py_typeof(py_Ref self); py_Type py_typeof(py_Ref self);
/// Get type by module and name. e.g. `py_gettype("time", "struct_time")`. /// Get type by module and name. e.g. `py_gettype("time", py_name("struct_time"))`.
/// Return `0` if not found. /// Return `0` if not found.
py_Type py_gettype(const char* module, py_Name name); py_Type py_gettype(const char* module, py_Name name);
/// Check if the object is exactly the given type. /// Check if the object is exactly the given type.

View File

@ -21,9 +21,6 @@ py_Ref py_getdict(py_Ref self, py_Name name) {
void py_setdict(py_Ref self, py_Name name, py_Ref val) { void py_setdict(py_Ref self, py_Name name, py_Ref val) {
assert(self && self->is_ptr); assert(self && self->is_ptr);
// if(py_isidentical(self, &pk_current_vm->main)){
// printf("Setting main: %s\n", py_name2str(name));
// }
if(!py_ismagicname(name) || self->type != tp_type) { if(!py_ismagicname(name) || self->type != tp_type) {
NameDict__set(PyObject__dict(self->_obj), name, *val); NameDict__set(PyObject__dict(self->_obj), name, *val);
} else { } else {