Skip to content

Commit

Permalink
Fix a few typos in mypyc's comments and docstrings (#14617)
Browse files Browse the repository at this point in the history
  • Loading branch information
yilei committed Feb 6, 2023
1 parent 07f6721 commit 6787e51
Show file tree
Hide file tree
Showing 9 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion mypyc/codegen/emitclass.py
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ def emit_line() -> None:
flags.append("_Py_TPFLAGS_HAVE_VECTORCALL")
if not fields.get("tp_vectorcall"):
# This is just a placeholder to please CPython. It will be
# overriden during setup.
# overridden during setup.
fields["tp_call"] = "PyVectorcall_Call"
fields["tp_flags"] = " | ".join(flags)

Expand Down
2 changes: 1 addition & 1 deletion mypyc/codegen/emitfunc.py
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ def visit_set_attr(self, op: SetAttr) -> None:
# ...and struct access for normal attributes.
attr_expr = self.get_attr_expr(obj, op, decl_cl)
if not op.is_init and attr_rtype.is_refcounted:
# This is not an initalization (where we know that the attribute was
# This is not an initialization (where we know that the attribute was
# previously undefined), so decref the old value.
always_defined = cl.is_always_defined(op.attr)
if not always_defined:
Expand Down
2 changes: 1 addition & 1 deletion mypyc/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
MAX_LITERAL_SHORT_INT: Final = MAX_SHORT_INT
MIN_LITERAL_SHORT_INT: Final = -MAX_LITERAL_SHORT_INT - 1

# Decription of the C type used to track the definedness of attributes and
# Description of the C type used to track the definedness of attributes and
# the presence of argument default values that have types with overlapping
# error values. Each tracked attribute/argument has a dedicated bit in the
# relevant bitmap.
Expand Down
2 changes: 1 addition & 1 deletion mypyc/doc/using_type_annotations.rst
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ Example::
def example() -> None:
# A small integer uses the value (unboxed) representation
x = 5
# A large integer the the heap (boxed) representation
# A large integer uses the heap (boxed) representation
x = 2**500
# Lists always contain boxed integers
a = [55]
Expand Down
4 changes: 2 additions & 2 deletions mypyc/irbuild/function.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ def transform_decorator(builder: IRBuilder, dec: Decorator) -> None:
# if this is a registered singledispatch implementation with no other decorators), we should
# treat this function as a regular function, not a decorated function
elif dec.func in builder.fdefs_to_decorators:
# Obtain the the function name in order to construct the name of the helper function.
# Obtain the function name in order to construct the name of the helper function.
name = dec.func.fullname.split(".")[-1]

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

if is_decorated(builder, fdef):
# Obtain the the function name in order to construct the name of the helper function.
# Obtain the function name in order to construct the name of the helper function.
_, _, name = fdef.fullname.rpartition(".")
# Read the PyTypeObject representing the class, get the callable object
# representing the non-decorated method
Expand Down
2 changes: 1 addition & 1 deletion mypyc/irbuild/ll_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -1386,7 +1386,7 @@ def compare_tagged_condition(
) -> None:
"""Compare two tagged integers using given operator (conditional context).
Assume lhs and and rhs are tagged integers.
Assume lhs and rhs are tagged integers.
Args:
lhs: Left operand
Expand Down
2 changes: 1 addition & 1 deletion mypyc/lib-rt/dict_ops.c
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ PyObject *CPyDict_SetDefaultWithEmptyDatatype(PyObject *dict, PyObject *key,
int data_type) {
PyObject *res = CPyDict_GetItem(dict, key);
if (!res) {
// CPyDict_GetItem() would generates an PyExc_KeyError
// CPyDict_GetItem() would generates a PyExc_KeyError
// when key is not found.
PyErr_Clear();

Expand Down
2 changes: 1 addition & 1 deletion mypyc/lib-rt/str_ops.c
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ PyObject *CPyStr_GetSlice(PyObject *obj, CPyTagged start, CPyTagged end) {
return CPyObject_GetSlice(obj, start, end);
}

/* Check if the given string is true (i.e. it's length isn't zero) */
/* Check if the given string is true (i.e. its length isn't zero) */
bool CPyStr_IsTrue(PyObject *obj) {
Py_ssize_t length = PyUnicode_GET_LENGTH(obj);
return length != 0;
Expand Down
2 changes: 1 addition & 1 deletion mypyc/test/test_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ def run_case_step(self, testcase: DataDrivenTestCase, incremental_step: int) ->
assert False, "Compile error"

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

Expand Down

0 comments on commit 6787e51

Please sign in to comment.