Skip to content

Commit

Permalink
Fixes typos in mypyc (#10800)
Browse files Browse the repository at this point in the history
  • Loading branch information
sobolevn authored Jul 10, 2021
1 parent a9f3b5e commit 24f3ba0
Show file tree
Hide file tree
Showing 10 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion mypyc/analysis/dataflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,7 @@ def analyze_live_regs(blocks: List[BasicBlock],
MAYBE_ANALYSIS = 1


# TODO the return type of this function is too complicated. Abtract it into its
# TODO the return type of this function is too complicated. Abstract it into its
# own class.

def run_analysis(blocks: List[BasicBlock],
Expand Down
2 changes: 1 addition & 1 deletion mypyc/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,7 @@ def mypycify(
setup_mypycify_vars()

# Create a compiler object so we can make decisions based on what
# compiler is being used. typeshed is missing some attribues on the
# compiler is being used. typeshed is missing some attributes on the
# compiler object so we give it type Any
compiler: Any = ccompiler.new_compiler()
sysconfig.customize_compiler(compiler)
Expand Down
2 changes: 1 addition & 1 deletion mypyc/codegen/emit.py
Original file line number Diff line number Diff line change
Expand Up @@ -635,7 +635,7 @@ def emit_unbox(self,
borrow: bool = False) -> None:
"""Emit code for unboxing a value of given type (from PyObject *).
By default, assing error value to dest if the value has an
By default, assign error value to dest if the value has an
incompatible type and raise TypeError. These can be customized
using 'error' and 'raise_exception'.
Expand Down
2 changes: 1 addition & 1 deletion mypyc/ir/class_ir.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ def __init__(self, name: str, module_name: str, is_trait: bool = False,
# base_mro is the chain of concrete (non-trait) ancestors
self.base_mro: List[ClassIR] = [self]

# Direct subclasses of this class (use subclasses() to also incude non-direct ones)
# Direct subclasses of this class (use subclasses() to also include non-direct ones)
# None if separate compilation prevents this from working
self.children: Optional[List[ClassIR]] = []

Expand Down
2 changes: 1 addition & 1 deletion mypyc/ir/func_ir.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ def all_values_full(args: List[Register], blocks: List[BasicBlock]) -> List[Valu
for block in blocks:
for op in block.ops:
for source in op.sources():
# Look for unitialized registers that are accessed. Ignore
# Look for uninitialized registers that are accessed. Ignore
# non-registers since we don't allow ops outside basic blocks.
if isinstance(source, Register) and source not in seen_registers:
values.append(source)
Expand Down
2 changes: 1 addition & 1 deletion mypyc/ir/rtypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -614,7 +614,7 @@ def accept(self, visitor: 'RTypeVisitor[T]') -> T:
return visitor.visit_rstruct(self)

def __str__(self) -> str:
# if not tuple(unamed structs)
# if not tuple(unnamed structs)
return '%s{%s}' % (self.name, ', '.join(name + ":" + str(typ)
for name, typ in zip(self.names, self.types)))

Expand Down
2 changes: 1 addition & 1 deletion mypyc/irbuild/classdef.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ def transform_class_def(builder: IRBuilder, cdef: ClassDef) -> None:
non_ext_class
], cdef.line)

# Cache any cachable class attributes
# Cache any cacheable class attributes
cache_class_attrs(builder, attrs_to_cache, cdef)


Expand Down
2 changes: 1 addition & 1 deletion mypyc/irbuild/for_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,7 @@ def gen_step(self) -> None:

def gen_cleanup(self) -> None:
# We set the branch to go here if the conditional evaluates to true. If
# an exception was raised during the loop, then err_reg wil be set to
# an exception was raised during the loop, then err_reg will be set to
# True. If no_err_occurred_op returns False, then the exception will be
# propagated using the ERR_FALSE flag.
self.builder.call_c(no_err_occurred_op, [], self.line)
Expand Down
2 changes: 1 addition & 1 deletion mypyc/lib-rt/pythonsupport.h
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ _PyDict_GetItemStringWithError(PyObject *v, const char *key)

#if PY_MAJOR_VERSION >= 3 && PY_MINOR_VERSION < 6
/* _PyUnicode_EqualToASCIIString got added in 3.5.3 (argh!) so we can't actually know
* whether it will be precent at runtime, so we just assume we don't have it in 3.5. */
* whether it will be present at runtime, so we just assume we don't have it in 3.5. */
#define CPyUnicode_EqualToASCIIString(x, y) (PyUnicode_CompareWithASCIIString((x), (y)) == 0)
#elif PY_MAJOR_VERSION >= 3 && PY_MINOR_VERSION >= 6
#define CPyUnicode_EqualToASCIIString(x, y) _PyUnicode_EqualToASCIIString(x, y)
Expand Down
4 changes: 2 additions & 2 deletions mypyc/test/testutil.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def use_custom_builtins(builtins_path: str, testcase: DataDrivenTestCase) -> Ite
shutil.copyfile(builtins_path, builtins)
default_builtins = True

# Actually peform the test case.
# Actually perform the test case.
try:
yield None
finally:
Expand All @@ -76,7 +76,7 @@ def perform_test(func: Callable[[DataDrivenTestCase], None],
shutil.copyfile(builtins_path, builtins)
default_builtins = True

# Actually peform the test case.
# Actually perform the test case.
func(testcase)

if default_builtins:
Expand Down

0 comments on commit 24f3ba0

Please sign in to comment.