Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit b358610

Browse filesBrowse files
authored
more cspell (#4702)
1 parent 1235594 commit b358610
Copy full SHA for b358610

18 files changed

+134
-54
lines changed

‎.cspell.json

Copy file name to clipboardExpand all lines: .cspell.json
+63-1Lines changed: 63 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,50 +26,85 @@
2626
"words": [
2727
// Rust
2828
"ahash",
29+
"bidi",
30+
"biguint",
2931
"bindgen",
3032
"bitflags",
33+
"bstr",
34+
"byteorder",
3135
"chrono",
36+
"consts",
3237
"cstring",
3338
"flate2",
39+
"fract",
3440
"hasher",
3541
"idents",
3642
"indexmap",
3743
"insta",
3844
"keccak",
3945
"lalrpop",
4046
"libc",
47+
"libz",
48+
"longlong",
4149
"Manually",
4250
"maplit",
4351
"memmap",
4452
"metas",
53+
"modpow",
54+
"nanos",
4555
"peekable",
56+
"powc",
57+
"powf",
4658
"prepended",
4759
"punct",
60+
"replacen",
61+
"rsplitn",
4862
"rustc",
4963
"rustfmt",
5064
"splitn",
65+
"subsec",
66+
"timsort",
5167
"trai",
68+
"ulonglong",
5269
"unic",
5370
"unistd",
71+
"winapi",
72+
"winsock",
5473
// Python
5574
"abstractmethods",
5675
"aiter",
5776
"anext",
77+
"arrayiterator",
78+
"arraytype",
79+
"asend",
80+
"athrow",
5881
"basicsize",
5982
"cformat",
6083
"classcell",
84+
"closesocket",
6185
"codepoint",
86+
"codepoints",
6287
"cpython",
88+
"decompressor",
6389
"defaultaction",
6490
"descr",
6591
"dictcomp",
92+
"dictitems",
93+
"dictkeys",
94+
"dictview",
6695
"docstring",
6796
"docstrings",
6897
"dunder",
6998
"eventmask",
7099
"fdel",
100+
"fget",
71101
"fileencoding",
102+
"fillchar",
72103
"finallyhandler",
104+
"frombytes",
105+
"fromhex",
106+
"fromunicode",
107+
"fset",
73108
"fspath",
74109
"fstring",
75110
"fstrings",
@@ -79,26 +114,38 @@
79114
"getnewargs",
80115
"getweakrefcount",
81116
"getweakrefs",
117+
"hostnames",
82118
"idiv",
83119
"impls",
120+
"infj",
84121
"instancecheck",
85122
"instanceof",
123+
"isabstractmethod",
124+
"itemiterator",
86125
"itemsize",
87126
"iternext",
127+
"keyiterator",
88128
"kwarg",
89129
"kwargs",
90130
"linearization",
91131
"linearize",
92132
"listcomp",
93133
"mappingproxy",
94134
"maxsplit",
95-
"MemoryView",
135+
"memoryview",
136+
"memoryviewiterator",
96137
"metaclass",
97138
"metaclasses",
98139
"metatype",
140+
"mro",
141+
"mros",
142+
"nanj",
143+
"ndigits",
99144
"ndim",
100145
"nonbytes",
101146
"origname",
147+
"posixsubprocess",
148+
"pyexpat",
102149
"PYTHONDEBUG",
103150
"PYTHONHOME",
104151
"PYTHONINSPECT",
@@ -108,14 +155,27 @@
108155
"PYTHONVERBOSE",
109156
"PYTHONWARNINGS",
110157
"qualname",
158+
"radd",
111159
"rdiv",
160+
"rdivmod",
161+
"reconstructor",
162+
"reversevalueiterator",
163+
"rfloordiv",
164+
"rlshift",
165+
"rmod",
166+
"rpow",
167+
"rrshift",
168+
"rsub",
169+
"rtruediv",
170+
"scproxy",
112171
"setattro",
113172
"setcomp",
114173
"stacklevel",
115174
"subclasscheck",
116175
"subclasshook",
117176
"unionable",
118177
"unraisablehook",
178+
"valueiterator",
119179
"vararg",
120180
"varargs",
121181
"varnames",
@@ -165,6 +225,7 @@
165225
"pystruct",
166226
"pystructseq",
167227
"pytrace",
228+
"reducelib",
168229
"richcompare",
169230
"RustPython",
170231
"struc",
@@ -215,6 +276,7 @@
215276
"unparser",
216277
"VARKEYWORDS",
217278
"varkwarg",
279+
"wbits",
218280
"withitem",
219281
"withs"
220282
],

‎stdlib/src/array.rs

Copy file name to clipboardExpand all lines: stdlib/src/array.rs
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// spell-checker:ignore typecode tofile tolist fromfile
2+
13
use rustpython_vm::{PyObjectRef, VirtualMachine};
24

35
pub(crate) fn make_module(vm: &VirtualMachine) -> PyObjectRef {

‎stdlib/src/binascii.rs

Copy file name to clipboardExpand all lines: stdlib/src/binascii.rs
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// spell-checker:ignore hexlify unhexlify uuencodes
2+
13
pub(super) use decl::crc32;
24
pub(crate) use decl::make_module;
35
use rustpython_vm::{builtins::PyBaseExceptionRef, convert::ToPyException, VirtualMachine};

‎stdlib/src/bz2.rs

Copy file name to clipboardExpand all lines: stdlib/src/bz2.rs
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// spell-checker:ignore compresslevel
2+
13
pub(crate) use _bz2::make_module;
24

35
#[pymodule]

‎stdlib/src/hashlib.rs

Copy file name to clipboardExpand all lines: stdlib/src/hashlib.rs
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// spell-checker:ignore usedforsecurity HASHXOF
2+
13
pub(crate) use hashlib::make_module;
24

35
#[pymodule]

‎stdlib/src/syslog.rs

Copy file name to clipboardExpand all lines: stdlib/src/syslog.rs
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// spell-checker:ignore logoption openlog setlogmask upto
2+
13
pub(crate) use syslog::make_module;
24

35
#[pymodule(name = "syslog")]

‎stdlib/src/unicodedata.rs

Copy file name to clipboardExpand all lines: stdlib/src/unicodedata.rs
+3Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
/* Access to the unicode database.
22
See also: https://docs.python.org/3/library/unicodedata.html
33
*/
4+
5+
// spell-checker:ignore nfkc unistr unidata
6+
47
use crate::vm::{
58
builtins::PyStr, convert::TryFromBorrowedObject, PyObject, PyObjectRef, PyPayload, PyResult,
69
VirtualMachine,

‎stdlib/src/zlib.rs

Copy file name to clipboardExpand all lines: stdlib/src/zlib.rs
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// spell-checker:ignore compressobj decompressobj zdict chunksize zlibmodule miniz
2+
13
pub(crate) use zlib::make_module;
24

35
#[pymodule]

‎vm/src/anystr.rs

Copy file name to clipboardExpand all lines: vm/src/anystr.rs
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ pub trait AnyStr {
194194
SW: Fn(&Self, isize, &VirtualMachine) -> Vec<R>,
195195
{
196196
let (sep, maxsplit) = args.get_value(vm)?;
197-
let splited = if let Some(pattern) = sep {
197+
let splits = if let Some(pattern) = sep {
198198
if maxsplit < 0 {
199199
split(self, pattern.as_ref(), vm)
200200
} else {
@@ -203,7 +203,7 @@ pub trait AnyStr {
203203
} else {
204204
splitw(self, maxsplit, vm)
205205
};
206-
Ok(splited)
206+
Ok(splits)
207207
}
208208
fn py_split_whitespace<F>(&self, maxsplit: isize, convert: F) -> Vec<PyObjectRef>
209209
where

‎vm/src/builtins/float.rs

Copy file name to clipboardExpand all lines: vm/src/builtins/float.rs
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// spell-checker:ignore numer denom
2+
13
use super::{
24
try_bigint_to_f64, PyByteArray, PyBytes, PyInt, PyIntRef, PyStr, PyStrRef, PyType, PyTypeRef,
35
};

‎vm/src/builtins/genericalias.rs

Copy file name to clipboardExpand all lines: vm/src/builtins/genericalias.rs
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -225,9 +225,9 @@ fn make_parameters(args: &PyTupleRef, vm: &VirtualMachine) -> PyTupleRef {
225225
.get_attr(identifier!(vm, __parameters__), vm)
226226
.and_then(|obj| PyTupleRef::try_from_object(vm, obj))
227227
{
228-
for subparam in &subparams {
229-
if !parameters.iter().any(|param| param.is(subparam)) {
230-
parameters.push(subparam.clone());
228+
for sub_param in &subparams {
229+
if !parameters.iter().any(|param| param.is(sub_param)) {
230+
parameters.push(sub_param.clone());
231231
}
232232
}
233233
}

‎vm/src/builtins/range.rs

Copy file name to clipboardExpand all lines: vm/src/builtins/range.rs
+9-9Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -345,19 +345,19 @@ impl PyRange {
345345
fn getitem(&self, subscript: PyObjectRef, vm: &VirtualMachine) -> PyResult {
346346
match RangeIndex::try_from_object(vm, subscript)? {
347347
RangeIndex::Slice(slice) => {
348-
let (mut substart, mut substop, mut substep) =
348+
let (mut sub_start, mut sub_stop, mut sub_step) =
349349
slice.inner_indices(&self.compute_length(), vm)?;
350350
let range_step = &self.step;
351351
let range_start = &self.start;
352352

353-
substep *= range_step.as_bigint();
354-
substart = (substart * range_step.as_bigint()) + range_start.as_bigint();
355-
substop = (substop * range_step.as_bigint()) + range_start.as_bigint();
353+
sub_step *= range_step.as_bigint();
354+
sub_start = (sub_start * range_step.as_bigint()) + range_start.as_bigint();
355+
sub_stop = (sub_stop * range_step.as_bigint()) + range_start.as_bigint();
356356

357357
Ok(PyRange {
358-
start: vm.new_pyref(substart),
359-
stop: vm.new_pyref(substop),
360-
step: vm.new_pyref(substep),
358+
start: vm.new_pyref(sub_start),
359+
stop: vm.new_pyref(sub_stop),
360+
step: vm.new_pyref(sub_step),
361361
}
362362
.into_ref(vm)
363363
.into())
@@ -582,8 +582,8 @@ impl IterNext for PyLongRangeIterator {
582582
}
583583
}
584584

585-
// When start, stop, step are isizes, we can use a faster more compact representation
586-
// that only operates using isizes to track values.
585+
// When start, stop, step are isize, we can use a faster more compact representation
586+
// that only operates using isize to track values.
587587
#[pyclass(module = false, name = "range_iterator")]
588588
#[derive(Debug)]
589589
pub struct PyRangeIterator {

‎vm/src/builtins/slice.rs

Copy file name to clipboardExpand all lines: vm/src/builtins/slice.rs
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// sliceobject.{h,c} in CPython
2+
// spell-checker:ignore sliceobject
23
use super::{PyTupleRef, PyType, PyTypeRef};
34
use crate::{
45
class::PyClassImpl,

‎vm/src/builtins/str.rs

Copy file name to clipboardExpand all lines: vm/src/builtins/str.rs
+16-16Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -693,9 +693,9 @@ impl PyStr {
693693
/// If the string ends with the suffix string, return string[:len(suffix)]
694694
/// Otherwise, return a copy of the original string.
695695
#[pymethod]
696-
fn removesuffix(&self, suff: PyStrRef) -> String {
696+
fn removesuffix(&self, suffix: PyStrRef) -> String {
697697
self.as_str()
698-
.py_removesuffix(suff.as_str(), suff.byte_len(), |s, p| s.ends_with(p))
698+
.py_removesuffix(suffix.as_str(), suffix.byte_len(), |s, p| s.ends_with(p))
699699
.to_owned()
700700
}
701701

@@ -711,15 +711,15 @@ impl PyStr {
711711

712712
#[pymethod]
713713
fn isdigit(&self) -> bool {
714-
// python's isdigit also checks if exponents are digits, these are the unicodes for exponents
715-
let valid_unicodes: [u16; 10] = [
714+
// python's isdigit also checks if exponents are digits, these are the unicode codepoints for exponents
715+
let valid_codepoints: [u16; 10] = [
716716
0x2070, 0x00B9, 0x00B2, 0x00B3, 0x2074, 0x2075, 0x2076, 0x2077, 0x2078, 0x2079,
717717
];
718718
let s = self.as_str();
719719
!s.is_empty()
720720
&& s.chars()
721721
.filter(|c| !c.is_ascii_digit())
722-
.all(|c| valid_unicodes.contains(&(c as u16)))
722+
.all(|c| valid_codepoints.contains(&(c as u16)))
723723
}
724724

725725
#[pymethod]
@@ -827,12 +827,12 @@ impl PyStr {
827827
fn replace(&self, old: PyStrRef, new: PyStrRef, count: OptionalArg<isize>) -> String {
828828
let s = self.as_str();
829829
match count {
830-
OptionalArg::Present(maxcount) if maxcount >= 0 => {
831-
if maxcount == 0 || s.is_empty() {
830+
OptionalArg::Present(max_count) if max_count >= 0 => {
831+
if max_count == 0 || s.is_empty() {
832832
// nothing to do; return the original bytes
833833
s.into()
834834
} else {
835-
s.replacen(old.as_str(), new.as_str(), maxcount as usize)
835+
s.replacen(old.as_str(), new.as_str(), max_count as usize)
836836
}
837837
}
838838
_ => s.replace(old.as_str(), new.as_str()),
@@ -1692,7 +1692,7 @@ impl AnyStr for str {
16921692
F: Fn(&Self) -> PyObjectRef,
16931693
{
16941694
// CPython split_whitespace
1695-
let mut splited = Vec::new();
1695+
let mut splits = Vec::new();
16961696
let mut last_offset = 0;
16971697
let mut count = maxsplit;
16981698
for (offset, _) in self.match_indices(|c: char| c.is_ascii_whitespace() || c == '\x0b') {
@@ -1703,22 +1703,22 @@ impl AnyStr for str {
17031703
if count == 0 {
17041704
break;
17051705
}
1706-
splited.push(convert(&self[last_offset..offset]));
1706+
splits.push(convert(&self[last_offset..offset]));
17071707
last_offset = offset + 1;
17081708
count -= 1;
17091709
}
17101710
if last_offset != self.len() {
1711-
splited.push(convert(&self[last_offset..]));
1711+
splits.push(convert(&self[last_offset..]));
17121712
}
1713-
splited
1713+
splits
17141714
}
17151715

17161716
fn py_rsplit_whitespace<F>(&self, maxsplit: isize, convert: F) -> Vec<PyObjectRef>
17171717
where
17181718
F: Fn(&Self) -> PyObjectRef,
17191719
{
17201720
// CPython rsplit_whitespace
1721-
let mut splited = Vec::new();
1721+
let mut splits = Vec::new();
17221722
let mut last_offset = self.len();
17231723
let mut count = maxsplit;
17241724
for (offset, _) in self.rmatch_indices(|c: char| c.is_ascii_whitespace() || c == '\x0b') {
@@ -1729,14 +1729,14 @@ impl AnyStr for str {
17291729
if count == 0 {
17301730
break;
17311731
}
1732-
splited.push(convert(&self[offset + 1..last_offset]));
1732+
splits.push(convert(&self[offset + 1..last_offset]));
17331733
last_offset = offset;
17341734
count -= 1;
17351735
}
17361736
if last_offset != 0 {
1737-
splited.push(convert(&self[..last_offset]));
1737+
splits.push(convert(&self[..last_offset]));
17381738
}
1739-
splited
1739+
splits
17401740
}
17411741
}
17421742

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.