diff --git a/compiler/erg_compiler/context/initialize/mod.rs b/compiler/erg_compiler/context/initialize/mod.rs index 6fc695f9..98b02ad4 100644 --- a/compiler/erg_compiler/context/initialize/mod.rs +++ b/compiler/erg_compiler/context/initialize/mod.rs @@ -1119,7 +1119,7 @@ impl Context { generic_module.register_trait(g_module_t.clone(), generic_module_eq); let Path = mono_q_tp("Path", instanceof(Str)); let module_t = module(Path.clone()); - let py_module_t = py_module(Path, self.cfg.python_compatible_mode); + let py_module_t = py_module(Path); let mut module = Self::builtin_poly_class("Module", vec![PS::named_nd("Path", Str)], 2); module.register_superclass(g_module_t.clone(), &generic_module); let mut py_module = @@ -1849,7 +1849,7 @@ impl Context { let t_pyimport = nd_func( vec![anon(tp_enum(Str, set! {Path.clone()}))], None, - py_module(Path, self.cfg.python_compatible_mode), + py_module(Path), ) .quantify(); let t_pycompile = nd_func( diff --git a/compiler/erg_compiler/ty/constructors.rs b/compiler/erg_compiler/ty/constructors.rs index 149a2397..1ae276bd 100644 --- a/compiler/erg_compiler/ty/constructors.rs +++ b/compiler/erg_compiler/ty/constructors.rs @@ -65,13 +65,8 @@ pub fn module(path: TyParam) -> Type { } #[inline] -pub fn py_module(path: TyParam, py_comp_mode: bool) -> Type { - let name = if py_comp_mode { - "ModuleType" - } else { - "PyModule" - }; - poly(name, vec![path]) +pub fn py_module(path: TyParam) -> Type { + poly("PyModule", vec![path]) } pub fn module_from_path>(path: P) -> Type { diff --git a/compiler/erg_compiler/ty/mod.rs b/compiler/erg_compiler/ty/mod.rs index 1d34410f..9e63146a 100644 --- a/compiler/erg_compiler/ty/mod.rs +++ b/compiler/erg_compiler/ty/mod.rs @@ -1646,9 +1646,7 @@ impl Type { match self { Self::FreeVar(fv) if fv.is_linked() => fv.crack().is_module(), Self::Refinement(refine) => refine.t.is_module(), - Self::Poly { name, .. } => { - &name[..] == "PyModule" || &name[..] == "Module" || &name[..] == "ModuleType" - } + Self::Poly { name, .. } => &name[..] == "PyModule" || &name[..] == "Module", _ => false, } } @@ -1657,7 +1655,7 @@ impl Type { match self { Self::FreeVar(fv) if fv.is_linked() => fv.crack().is_py_module(), Self::Refinement(refine) => refine.t.is_py_module(), - Self::Poly { name, .. } => &name[..] == "PyModule" || &name[..] == "ModuleType", + Self::Poly { name, .. } => &name[..] == "PyModule", _ => false, } }