Skip to content

Commit 6787e51

Browse files
authored
Fix a few typos in mypyc's comments and docstrings (#14617)
1 parent 07f6721 commit 6787e51

File tree

9 files changed

+10
-10
lines changed

9 files changed

+10
-10
lines changed

mypyc/codegen/emitclass.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ def emit_line() -> None:
333333
flags.append("_Py_TPFLAGS_HAVE_VECTORCALL")
334334
if not fields.get("tp_vectorcall"):
335335
# This is just a placeholder to please CPython. It will be
336-
# overriden during setup.
336+
# overridden during setup.
337337
fields["tp_call"] = "PyVectorcall_Call"
338338
fields["tp_flags"] = " | ".join(flags)
339339

mypyc/codegen/emitfunc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,7 @@ def visit_set_attr(self, op: SetAttr) -> None:
432432
# ...and struct access for normal attributes.
433433
attr_expr = self.get_attr_expr(obj, op, decl_cl)
434434
if not op.is_init and attr_rtype.is_refcounted:
435-
# This is not an initalization (where we know that the attribute was
435+
# This is not an initialization (where we know that the attribute was
436436
# previously undefined), so decref the old value.
437437
always_defined = cl.is_always_defined(op.attr)
438438
if not always_defined:

mypyc/common.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
MAX_LITERAL_SHORT_INT: Final = MAX_SHORT_INT
5757
MIN_LITERAL_SHORT_INT: Final = -MAX_LITERAL_SHORT_INT - 1
5858

59-
# Decription of the C type used to track the definedness of attributes and
59+
# Description of the C type used to track the definedness of attributes and
6060
# the presence of argument default values that have types with overlapping
6161
# error values. Each tracked attribute/argument has a dedicated bit in the
6262
# relevant bitmap.

mypyc/doc/using_type_annotations.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ Example::
304304
def example() -> None:
305305
# A small integer uses the value (unboxed) representation
306306
x = 5
307-
# A large integer the the heap (boxed) representation
307+
# A large integer uses the heap (boxed) representation
308308
x = 2**500
309309
# Lists always contain boxed integers
310310
a = [55]

mypyc/irbuild/function.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ def transform_decorator(builder: IRBuilder, dec: Decorator) -> None:
123123
# if this is a registered singledispatch implementation with no other decorators), we should
124124
# treat this function as a regular function, not a decorated function
125125
elif dec.func in builder.fdefs_to_decorators:
126-
# Obtain the the function name in order to construct the name of the helper function.
126+
# Obtain the function name in order to construct the name of the helper function.
127127
name = dec.func.fullname.split(".")[-1]
128128

129129
# Load the callable object representing the non-decorated function, and decorate it.
@@ -397,7 +397,7 @@ def handle_ext_method(builder: IRBuilder, cdef: ClassDef, fdef: FuncDef) -> None
397397
builder.functions.append(func_ir)
398398

399399
if is_decorated(builder, fdef):
400-
# Obtain the the function name in order to construct the name of the helper function.
400+
# Obtain the function name in order to construct the name of the helper function.
401401
_, _, name = fdef.fullname.rpartition(".")
402402
# Read the PyTypeObject representing the class, get the callable object
403403
# representing the non-decorated method

mypyc/irbuild/ll_builder.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1386,7 +1386,7 @@ def compare_tagged_condition(
13861386
) -> None:
13871387
"""Compare two tagged integers using given operator (conditional context).
13881388
1389-
Assume lhs and and rhs are tagged integers.
1389+
Assume lhs and rhs are tagged integers.
13901390
13911391
Args:
13921392
lhs: Left operand

mypyc/lib-rt/dict_ops.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ PyObject *CPyDict_SetDefaultWithEmptyDatatype(PyObject *dict, PyObject *key,
8989
int data_type) {
9090
PyObject *res = CPyDict_GetItem(dict, key);
9191
if (!res) {
92-
// CPyDict_GetItem() would generates an PyExc_KeyError
92+
// CPyDict_GetItem() would generates a PyExc_KeyError
9393
// when key is not found.
9494
PyErr_Clear();
9595

mypyc/lib-rt/str_ops.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ PyObject *CPyStr_GetSlice(PyObject *obj, CPyTagged start, CPyTagged end) {
188188
return CPyObject_GetSlice(obj, start, end);
189189
}
190190

191-
/* Check if the given string is true (i.e. it's length isn't zero) */
191+
/* Check if the given string is true (i.e. its length isn't zero) */
192192
bool CPyStr_IsTrue(PyObject *obj) {
193193
Py_ssize_t length = PyUnicode_GET_LENGTH(obj);
194194
return length != 0;

mypyc/test/test_run.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ def run_case_step(self, testcase: DataDrivenTestCase, incremental_step: int) ->
255255
assert False, "Compile error"
256256

257257
# Check that serialization works on this IR. (Only on the first
258-
# step because the the returned ir only includes updated code.)
258+
# step because the returned ir only includes updated code.)
259259
if incremental_step == 1:
260260
check_serialization_roundtrip(ir)
261261

0 commit comments

Comments
 (0)