Skip to content

Commit daca1f3

Browse files
committed
Fix cspell warnings
1 parent 5df8d29 commit daca1f3

File tree

2 files changed

+15
-8
lines changed

2 files changed

+15
-8
lines changed

.cspell.json

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,11 +80,13 @@
8080
"rdiv",
8181
"idiv",
8282
"ndim",
83+
"unionable",
8384
"varnames",
8485
"getweakrefs",
8586
"getweakrefcount",
8687
"stacklevel",
8788
"MemoryView",
89+
"metatype",
8890
"warningregistry",
8991
"defaultaction",
9092
"unraisablehook",
@@ -129,7 +131,12 @@
129131
"posonlyargs",
130132
"kwonlyargs",
131133
"uninit",
132-
"miri"
134+
"miri",
135+
// cpython
136+
"linearise",
137+
"dictoffset",
138+
"heaptype",
139+
"IMMUTABLETYPE"
133140
],
134141
// flagWords - list of words to be always considered incorrect
135142
"flagWords": [

vm/src/builtins/type.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -868,11 +868,11 @@ impl PyType {
868868
})?;
869869
}
870870

871-
if let Some(initter) = typ.get_super_attr(identifier!(vm, __init_subclass__)) {
872-
let initter = vm
873-
.call_get_descriptor_specific(initter.clone(), None, Some(typ.clone().into()))
874-
.unwrap_or(Ok(initter))?;
875-
vm.invoke(&initter, kwargs)?;
871+
if let Some(init_subclass) = typ.get_super_attr(identifier!(vm, __init_subclass__)) {
872+
let init_subclass = vm
873+
.call_get_descriptor_specific(init_subclass.clone(), None, Some(typ.clone().into()))
874+
.unwrap_or(Ok(init_subclass))?;
875+
vm.invoke(&init_subclass, kwargs)?;
876876
};
877877

878878
Ok(typ.into())
@@ -1156,14 +1156,14 @@ fn take_next_base(bases: &mut [Vec<PyTypeRef>]) -> Option<PyTypeRef> {
11561156
}
11571157

11581158
fn linearise_mro(mut bases: Vec<Vec<PyTypeRef>>) -> Result<Vec<PyTypeRef>, String> {
1159-
vm_trace!("Linearising MRO: {:?}", bases);
1159+
vm_trace!("Linearise MRO: {:?}", bases);
11601160
// Python requires that the class direct bases are kept in the same order.
11611161
// This is called local precedence ordering.
11621162
// This means we must verify that for classes A(), B(A) we must reject C(A, B) even though this
11631163
// algorithm will allow the mro ordering of [C, B, A, object].
11641164
// To verify this, we make sure non of the direct bases are in the mro of bases after them.
11651165
for (i, base_mro) in bases.iter().enumerate() {
1166-
let base = &base_mro[0]; // Mros cannot be empty.
1166+
let base = &base_mro[0]; // MROs cannot be empty.
11671167
for later_mro in &bases[i + 1..] {
11681168
// We start at index 1 to skip direct bases.
11691169
// This will not catch duplicate bases, but such a thing is already tested for.

0 commit comments

Comments
 (0)