Skip to content

Commit 9a89898

Browse files
luzpaztushar-deepsource
authored andcommitted
Fix typos (python#11498)
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`
1 parent 893bcfd commit 9a89898

File tree

13 files changed

+17
-17
lines changed

13 files changed

+17
-17
lines changed

docs/source/error_code_list.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -545,7 +545,7 @@ Check instantiation of abstract classes [abstract]
545545
--------------------------------------------------
546546

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

551551
Sometimes a class is made accidentally abstract, often due to an

docs/source/extending_mypy.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ when the configuration for a module changes, we want to invalidate
246246
mypy's cache for that module so that it can be rechecked. This hook
247247
should be used to report to mypy any relevant configuration data,
248248
so that mypy knows to recheck the module if the configuration changes.
249-
The hooks hould return data encodable as JSON.
249+
The hooks should return data encodable as JSON.
250250

251251
Notes about the semantic analyzer
252252
*********************************

mypy/checker.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2558,7 +2558,7 @@ def check_final(self,
25582558
name = lv.node.name
25592559
cls = self.scope.active_class()
25602560
if cls is not None:
2561-
# Theses additional checks exist to give more error messages
2561+
# These additional checks exist to give more error messages
25622562
# even if the final attribute was overridden with a new symbol
25632563
# (which is itself an error)...
25642564
for base in cls.mro[1:]:

mypy/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1010,7 +1010,7 @@ def set_strict_flags() -> None:
10101010
process_cache_map(parser, special_opts, options)
10111011

10121012
# An explicitly specified cache_fine_grained implies local_partial_types
1013-
# (because otherwise the cache is not compatiable with dmypy)
1013+
# (because otherwise the cache is not compatible with dmypy)
10141014
if options.cache_fine_grained:
10151015
options.local_partial_types = True
10161016

mypy/plugins/dataclasses.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ def add_slots(self,
217217
)
218218
return
219219
if info.slots is not None or info.names.get('__slots__'):
220-
# This means we have a slots confict.
220+
# This means we have a slots conflict.
221221
# Class explicitly specifies `__slots__` field.
222222
# And `@dataclass(slots=True)` is used.
223223
# In runtime this raises a type error.

mypy/plugins/singledispatch.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ def singledispatch_register_callback(ctx: MethodContext) -> Type:
123123
# TODO: check that there's only one argument
124124
first_arg_type = get_proper_type(get_first_arg(ctx.arg_types))
125125
if isinstance(first_arg_type, (CallableType, Overloaded)) and first_arg_type.is_type_obj():
126-
# HACK: We receieved a class as an argument to register. We need to be able
126+
# HACK: We received a class as an argument to register. We need to be able
127127
# to access the function that register is being applied to, and the typeshed definition
128128
# of register has it return a generic Callable, so we create a new
129129
# SingleDispatchRegisterCallable class, define a __call__ method, and then add a

mypy/semanal_main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ def process_top_level_function(analyzer: 'SemanticAnalyzer',
249249
"""Analyze single top-level function or method.
250250
251251
Process the body of the function (including nested functions) again and again,
252-
until all names have been resolved (ot iteration limit reached).
252+
until all names have been resolved (or iteration limit reached).
253253
"""
254254
# We need one more iteration after incomplete is False (e.g. to report errors, if any).
255255
final_iteration = False

mypy/server/update.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1077,7 +1077,7 @@ def not_found() -> None:
10771077
# A ClassDef target covers the body of the class and everything defined
10781078
# within it. To get the body we include the entire surrounding target,
10791079
# typically a module top-level, since we don't support processing class
1080-
# bodies as separate entitites for simplicity.
1080+
# bodies as separate entities for simplicity.
10811081
assert file is not None
10821082
if node.fullname != target:
10831083
# This is a reference to a different TypeInfo, likely due to a stale dependency.

mypy/stubgen.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1077,7 +1077,7 @@ def visit_import_from(self, o: ImportFrom) -> None:
10771077
self.record_name(alias or name)
10781078

10791079
if self._all_:
1080-
# Include import froms that import names defined in __all__.
1080+
# Include import forms that import names defined in __all__.
10811081
names = [name for name, alias in o.names
10821082
if name in self._all_ and alias is None and name not in IGNORED_DUNDERS]
10831083
exported_names.update(names)

mypyc/ir/class_ir.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ def __init__(self, name: str, module_name: str, is_trait: bool = False,
121121
# Map of methods that are actually present in an extension class
122122
self.methods: OrderedDict[str, FuncIR] = OrderedDict()
123123
# Glue methods for boxing/unboxing when a class changes the type
124-
# while overriding a method. Maps from (parent class overrided, method)
124+
# while overriding a method. Maps from (parent class overridden, method)
125125
# to IR of glue method.
126126
self.glue_methods: Dict[Tuple[ClassIR, str], FuncIR] = OrderedDict()
127127

mypyc/test-data/run-classes.test

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1591,13 +1591,13 @@ from mypy_extensions import trait
15911591
class Temperature:
15921592
@property
15931593
def celsius(self) -> float:
1594-
return 5.0 * (self.farenheit - 32.0) / 9.0
1594+
return 5.0 * (self.fahrenheit - 32.0) / 9.0
15951595

1596-
def __init__(self, farenheit: float) -> None:
1597-
self.farenheit = farenheit
1596+
def __init__(self, fahrenheit: float) -> None:
1597+
self.fahrenheit = fahrenheit
15981598

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

16021602
@property
16031603
def rankine(self) -> float:

test-data/stdlib-samples/3.2/shutil.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ class ReadError(EnvironmentError):
5858
"""Raised when an archive cannot be read"""
5959

6060
class RegistryError(Exception):
61-
"""Raised when a registery operation with the archiving
61+
"""Raised when a registry operation with the archiving
6262
and unpacking registeries fails"""
6363

6464

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

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

682682
def _ensure_directory(path: str) -> None:

test-data/unit/hacks.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ y = '' # This could be valid if a new 'y' is defined here
3939
```
4040

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

0 commit comments

Comments
 (0)