diff --git a/docs/source/error_code_list.rst b/docs/source/error_code_list.rst index 3afde02e3ee6..13cb464f7984 100644 --- a/docs/source/error_code_list.rst +++ b/docs/source/error_code_list.rst @@ -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 diff --git a/docs/source/extending_mypy.rst b/docs/source/extending_mypy.rst index 90e5f2f1fec1..6d5dc79409a8 100644 --- a/docs/source/extending_mypy.rst +++ b/docs/source/extending_mypy.rst @@ -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 ********************************* diff --git a/mypy/checker.py b/mypy/checker.py index d4548f581a28..95789831fd6f 100644 --- a/mypy/checker.py +++ b/mypy/checker.py @@ -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:]: diff --git a/mypy/main.py b/mypy/main.py index e478d65a6fca..fdf645fe6ba1 100644 --- a/mypy/main.py +++ b/mypy/main.py @@ -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 diff --git a/mypy/plugins/dataclasses.py b/mypy/plugins/dataclasses.py index dab1fc23ef26..0bed61e3eeb1 100644 --- a/mypy/plugins/dataclasses.py +++ b/mypy/plugins/dataclasses.py @@ -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. diff --git a/mypy/plugins/singledispatch.py b/mypy/plugins/singledispatch.py index d0965b997ac7..104faa38d1ce 100644 --- a/mypy/plugins/singledispatch.py +++ b/mypy/plugins/singledispatch.py @@ -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 diff --git a/mypy/semanal_main.py b/mypy/semanal_main.py index d8b5db440ecd..7e187945da48 100644 --- a/mypy/semanal_main.py +++ b/mypy/semanal_main.py @@ -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 diff --git a/mypy/server/update.py b/mypy/server/update.py index 03d79b8af7fb..e82064c63a11 100644 --- a/mypy/server/update.py +++ b/mypy/server/update.py @@ -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. diff --git a/mypy/stubgen.py b/mypy/stubgen.py index 65417daac580..56e0fcb27763 100755 --- a/mypy/stubgen.py +++ b/mypy/stubgen.py @@ -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) diff --git a/mypyc/ir/class_ir.py b/mypyc/ir/class_ir.py index 746fa45db327..65274e425098 100644 --- a/mypyc/ir/class_ir.py +++ b/mypyc/ir/class_ir.py @@ -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() diff --git a/mypyc/test-data/run-classes.test b/mypyc/test-data/run-classes.test index 98b1cc86e5ac..e2beca1bafc6 100644 --- a/mypyc/test-data/run-classes.test +++ b/mypyc/test-data/run-classes.test @@ -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: diff --git a/test-data/stdlib-samples/3.2/shutil.py b/test-data/stdlib-samples/3.2/shutil.py index e7b5e5aacd04..bcefb7787952 100644 --- a/test-data/stdlib-samples/3.2/shutil.py +++ b/test-data/stdlib-samples/3.2/shutil.py @@ -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""" @@ -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: diff --git a/test-data/unit/hacks.txt b/test-data/unit/hacks.txt index 501a722fa359..43114a8af004 100644 --- a/test-data/unit/hacks.txt +++ b/test-data/unit/hacks.txt @@ -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.