Skip to content

Commit

Permalink
Fix typos (#11498)
Browse files Browse the repository at this point in the history
Found via `codespell -q 3 -S ./mypyc/external/googletest -L alo,ans,asend,ba,bre,dne,fo,haa,ist,larg,myu,nams,spawnve,statics,thow,ure,wont`
  • Loading branch information
luzpaz authored Nov 9, 2021
1 parent 2907a4d commit f194551
Show file tree
Hide file tree
Showing 13 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion docs/source/error_code_list.rst
Original file line number Diff line number Diff line change
Expand Up @@ -545,7 +545,7 @@ Check instantiation of abstract classes [abstract]
--------------------------------------------------

Mypy generates an error if you try to instantiate an abstract base
class (ABC). An abtract base class is a class with at least one
class (ABC). An abstract base class is a class with at least one
abstract method or attribute. (See also :py:mod:`abc` module documentation)

Sometimes a class is made accidentally abstract, often due to an
Expand Down
2 changes: 1 addition & 1 deletion docs/source/extending_mypy.rst
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ when the configuration for a module changes, we want to invalidate
mypy's cache for that module so that it can be rechecked. This hook
should be used to report to mypy any relevant configuration data,
so that mypy knows to recheck the module if the configuration changes.
The hooks hould return data encodable as JSON.
The hooks should return data encodable as JSON.

Notes about the semantic analyzer
*********************************
Expand Down
2 changes: 1 addition & 1 deletion mypy/checker.py
Original file line number Diff line number Diff line change
Expand Up @@ -2558,7 +2558,7 @@ def check_final(self,
name = lv.node.name
cls = self.scope.active_class()
if cls is not None:
# Theses additional checks exist to give more error messages
# These additional checks exist to give more error messages
# even if the final attribute was overridden with a new symbol
# (which is itself an error)...
for base in cls.mro[1:]:
Expand Down
2 changes: 1 addition & 1 deletion mypy/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -1010,7 +1010,7 @@ def set_strict_flags() -> None:
process_cache_map(parser, special_opts, options)

# An explicitly specified cache_fine_grained implies local_partial_types
# (because otherwise the cache is not compatiable with dmypy)
# (because otherwise the cache is not compatible with dmypy)
if options.cache_fine_grained:
options.local_partial_types = True

Expand Down
2 changes: 1 addition & 1 deletion mypy/plugins/dataclasses.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ def add_slots(self,
)
return
if info.slots is not None or info.names.get('__slots__'):
# This means we have a slots confict.
# This means we have a slots conflict.
# Class explicitly specifies `__slots__` field.
# And `@dataclass(slots=True)` is used.
# In runtime this raises a type error.
Expand Down
2 changes: 1 addition & 1 deletion mypy/plugins/singledispatch.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ def singledispatch_register_callback(ctx: MethodContext) -> Type:
# TODO: check that there's only one argument
first_arg_type = get_proper_type(get_first_arg(ctx.arg_types))
if isinstance(first_arg_type, (CallableType, Overloaded)) and first_arg_type.is_type_obj():
# HACK: We receieved a class as an argument to register. We need to be able
# HACK: We received a class as an argument to register. We need to be able
# to access the function that register is being applied to, and the typeshed definition
# of register has it return a generic Callable, so we create a new
# SingleDispatchRegisterCallable class, define a __call__ method, and then add a
Expand Down
2 changes: 1 addition & 1 deletion mypy/semanal_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ def process_top_level_function(analyzer: 'SemanticAnalyzer',
"""Analyze single top-level function or method.
Process the body of the function (including nested functions) again and again,
until all names have been resolved (ot iteration limit reached).
until all names have been resolved (or iteration limit reached).
"""
# We need one more iteration after incomplete is False (e.g. to report errors, if any).
final_iteration = False
Expand Down
2 changes: 1 addition & 1 deletion mypy/server/update.py
Original file line number Diff line number Diff line change
Expand Up @@ -1077,7 +1077,7 @@ def not_found() -> None:
# A ClassDef target covers the body of the class and everything defined
# within it. To get the body we include the entire surrounding target,
# typically a module top-level, since we don't support processing class
# bodies as separate entitites for simplicity.
# bodies as separate entities for simplicity.
assert file is not None
if node.fullname != target:
# This is a reference to a different TypeInfo, likely due to a stale dependency.
Expand Down
2 changes: 1 addition & 1 deletion mypy/stubgen.py
Original file line number Diff line number Diff line change
Expand Up @@ -1077,7 +1077,7 @@ def visit_import_from(self, o: ImportFrom) -> None:
self.record_name(alias or name)

if self._all_:
# Include import froms that import names defined in __all__.
# Include import forms that import names defined in __all__.
names = [name for name, alias in o.names
if name in self._all_ and alias is None and name not in IGNORED_DUNDERS]
exported_names.update(names)
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 @@ -121,7 +121,7 @@ def __init__(self, name: str, module_name: str, is_trait: bool = False,
# Map of methods that are actually present in an extension class
self.methods: OrderedDict[str, FuncIR] = OrderedDict()
# Glue methods for boxing/unboxing when a class changes the type
# while overriding a method. Maps from (parent class overrided, method)
# while overriding a method. Maps from (parent class overridden, method)
# to IR of glue method.
self.glue_methods: Dict[Tuple[ClassIR, str], FuncIR] = OrderedDict()

Expand Down
8 changes: 4 additions & 4 deletions mypyc/test-data/run-classes.test
Original file line number Diff line number Diff line change
Expand Up @@ -1591,13 +1591,13 @@ from mypy_extensions import trait
class Temperature:
@property
def celsius(self) -> float:
return 5.0 * (self.farenheit - 32.0) / 9.0
return 5.0 * (self.fahrenheit - 32.0) / 9.0

def __init__(self, farenheit: float) -> None:
self.farenheit = farenheit
def __init__(self, fahrenheit: float) -> None:
self.fahrenheit = fahrenheit

def print_temp(self) -> None:
print("F:", self.farenheit, "C:", self.celsius)
print("F:", self.fahrenheit, "C:", self.celsius)

@property
def rankine(self) -> float:
Expand Down
4 changes: 2 additions & 2 deletions test-data/stdlib-samples/3.2/shutil.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class ReadError(EnvironmentError):
"""Raised when an archive cannot be read"""

class RegistryError(Exception):
"""Raised when a registery operation with the archiving
"""Raised when a registry operation with the archiving
and unpacking registeries fails"""


Expand Down Expand Up @@ -676,7 +676,7 @@ def register_unpack_format(name: str, extensions: List[str], function: Any,
_UNPACK_FORMATS[name] = extensions, function, extra_args, description

def unregister_unpack_format(name: str) -> None:
"""Removes the pack format from the registery."""
"""Removes the pack format from the registry."""
del _UNPACK_FORMATS[name]

def _ensure_directory(path: str) -> None:
Expand Down
2 changes: 1 addition & 1 deletion test-data/unit/hacks.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ y = '' # This could be valid if a new 'y' is defined here
```

Note that some of the checks may turn out to be redundant, as the
exact rules for what constitues a redefinition are still up for
exact rules for what constitutes a redefinition are still up for
debate. This is okay since the extra if statements generally don't
otherwise affect semantics.

Expand Down

0 comments on commit f194551

Please sign in to comment.