Skip to content

Commit ecc13c8

Browse files
cdce8pcclauss
andauthored
Fix spelling (#18642)
Co-authored-by: Christian Clauss <[email protected]>
1 parent 29ffa3e commit ecc13c8

19 files changed

+23
-23
lines changed

docs/source/generics.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -999,7 +999,7 @@ similarly supported via generics (Python 3.12 syntax):
999999

10001000
.. code-block:: python
10011001
1002-
from colletions.abc import Callable
1002+
from collections.abc import Callable
10031003
from typing import Any
10041004
10051005
def route[F: Callable[..., Any]](url: str) -> Callable[[F], F]:

docs/source/more_types.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@ program:
390390
The ``summarize([])`` call matches both variants: an empty list could
391391
be either a ``list[int]`` or a ``list[str]``. In this case, mypy
392392
will break the tie by picking the first matching variant: ``output``
393-
will have an inferred type of ``float``. The implementor is responsible
393+
will have an inferred type of ``float``. The implementer is responsible
394394
for making sure ``summarize`` breaks ties in the same way at runtime.
395395

396396
However, there are two exceptions to the "pick the first match" rule.

docs/source/runtime_troubles.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ libraries if types are generic only in stubs.
274274
Using types defined in stubs but not at runtime
275275
-----------------------------------------------
276276

277-
Sometimes stubs that you're using may define types you wish to re-use that do
277+
Sometimes stubs that you're using may define types you wish to reuse that do
278278
not exist at runtime. Importing these types naively will cause your code to fail
279279
at runtime with ``ImportError`` or ``ModuleNotFoundError``. Similar to previous
280280
sections, these can be dealt with by using :ref:`typing.TYPE_CHECKING

mypy/argmap.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ def expand_actual_type(
220220
self.tuple_index += 1
221221
item = actual_type.items[self.tuple_index - 1]
222222
if isinstance(item, UnpackType) and not allow_unpack:
223-
# An upack item that doesn't have special handling, use upper bound as above.
223+
# An unpack item that doesn't have special handling, use upper bound as above.
224224
unpacked = get_proper_type(item.type)
225225
if isinstance(unpacked, TypeVarTupleType):
226226
fallback = get_proper_type(unpacked.upper_bound)

mypy/checkexpr.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -3184,7 +3184,7 @@ def combine_function_signatures(self, types: list[ProperType]) -> AnyType | Call
31843184
new_type_narrowers.append(target.type_is)
31853185

31863186
if new_type_guards and new_type_narrowers:
3187-
# They cannot be definined at the same time,
3187+
# They cannot be defined at the same time,
31883188
# declaring this function as too complex!
31893189
too_complex = True
31903190
union_type_guard = None

mypy/constraints.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ def _infer_constraints(
385385
res = []
386386
for a_item in actual.items:
387387
# `orig_template` has to be preserved intact in case it's recursive.
388-
# If we unwraped ``type[...]`` previously, wrap the item back again,
388+
# If we unwrapped ``type[...]`` previously, wrap the item back again,
389389
# as ``type[...]`` can't be removed from `orig_template`.
390390
if type_type_unwrapped:
391391
a_item = TypeType.make_normalized(a_item)

mypy/inspections.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -564,7 +564,7 @@ def run_inspection(
564564
) -> dict[str, object]:
565565
"""Top-level logic to inspect expression(s) at a location.
566566
567-
This can be re-used by various simple inspections.
567+
This can be reused by various simple inspections.
568568
"""
569569
try:
570570
file, pos = parse_location(location)

mypy/join.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,7 @@ def join_tuples(self, s: TupleType, t: TupleType) -> list[Type] | None:
451451
return items
452452
return None
453453
if s_unpack_index is not None and t_unpack_index is not None:
454-
# The most complex case: both tuples have an upack item.
454+
# The most complex case: both tuples have an unpack item.
455455
s_unpack = s.items[s_unpack_index]
456456
assert isinstance(s_unpack, UnpackType)
457457
s_unpacked = get_proper_type(s_unpack.type)

mypy/messages.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ def are_type_names_disabled(self) -> bool:
215215
def prefer_simple_messages(self) -> bool:
216216
"""Should we generate simple/fast error messages?
217217
218-
If errors aren't shown to the user, we don't want to waste cyles producing
218+
If errors aren't shown to the user, we don't want to waste cycles producing
219219
complex error messages.
220220
"""
221221
return self.errors.prefer_simple_messages()

mypy/semanal_namedtuple.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ def check_namedtuple_classdef(
198198
# Something is incomplete. We need to defer this named tuple.
199199
return None
200200
types.append(analyzed)
201-
# ...despite possible minor failures that allow further analyzis.
201+
# ...despite possible minor failures that allow further analysis.
202202
if name.startswith("_"):
203203
self.fail(
204204
f"NamedTuple field name cannot start with an underscore: {name}", stmt

mypy/semanal_newtype.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ def analyze_newtype_declaration(self, s: AssignmentStmt) -> tuple[str | None, Ca
174174
def check_newtype_args(
175175
self, name: str, call: CallExpr, context: Context
176176
) -> tuple[Type | None, bool]:
177-
"""Ananlyze base type in NewType call.
177+
"""Analyze base type in NewType call.
178178
179179
Return a tuple (type, should defer).
180180
"""

mypy/stubgenc.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ def get_pos_default(i: int, _arg: str) -> Any | None:
341341
# Add *args if present
342342
if varargs:
343343
arglist.append(ArgSig(f"*{varargs}", get_annotation(varargs)))
344-
# if we have keyword only args, then wee need to add "*"
344+
# if we have keyword only args, then we need to add "*"
345345
elif kwonlyargs:
346346
arglist.append(ArgSig("*"))
347347

mypy/suggestions.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,7 @@ def get_guesses_from_parent(self, node: FuncDef) -> list[CallableType]:
454454
pnode = parent.names.get(node.name)
455455
if pnode and isinstance(pnode.node, (FuncDef, Decorator)):
456456
typ = get_proper_type(pnode.node.type)
457-
# FIXME: Doesn't work right with generic tyeps
457+
# FIXME: Doesn't work right with generic types
458458
if isinstance(typ, CallableType) and len(typ.arg_types) == len(node.arguments):
459459
# Return the first thing we find, since it probably doesn't make sense
460460
# to grab things further up in the chain if an earlier parent has it.

mypy/type_visitor.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,7 @@ class TypeQuery(SyntheticTypeVisitor[T]):
344344
common use cases involve a boolean query using `any` or `all`.
345345
346346
Note: this visitor keeps an internal state (tracks type aliases to avoid
347-
recursion), so it should *never* be re-used for querying different types,
347+
recursion), so it should *never* be reused for querying different types,
348348
create a new visitor instance instead.
349349
350350
# TODO: check that we don't have existing violations of this rule.
@@ -467,7 +467,7 @@ class BoolTypeQuery(SyntheticTypeVisitor[bool]):
467467
be ANY_STRATEGY or ALL_STRATEGY.
468468
469469
Note: This visitor keeps an internal state (tracks type aliases to avoid
470-
recursion), so it should *never* be re-used for querying different types
470+
recursion), so it should *never* be reused for querying different types
471471
unless you call reset() first.
472472
"""
473473

mypyc/codegen/emitfunc.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ def generate_native_function(
152152
# generates them will add instructions between the branch and the
153153
# next label, causing the label to be wrongly removed. A better
154154
# solution would be to change the IR so that it adds a basic block
155-
# inbetween the calls.
155+
# in between the calls.
156156
is_problematic_op = isinstance(terminator, Branch) and any(
157157
isinstance(s, GetAttr) for s in terminator.sources()
158158
)

mypyc/doc/dev-intro.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ pretty-printed IR into `build/ops.txt`. This is the final IR that
229229
includes the output from exception and reference count handling
230230
insertion passes.
231231

232-
We also have tests that verify the generate IR
232+
We also have tests that verify the generated IR
233233
(`mypyc/test-data/irbuild-*.text`).
234234

235235
## Type-checking Mypyc
@@ -290,7 +290,7 @@ under `mypyc/lib-rt`.
290290

291291
## Inspecting Generated C
292292

293-
It's often useful to inspect the C code genenerate by mypyc to debug
293+
It's often useful to inspect the C code generated by mypyc to debug
294294
issues. Mypyc stores the generated C code as `build/__native.c`.
295295
Compiled native functions have the prefix `CPyDef_`, while wrapper
296296
functions used for calling functions from interpreted Python code have
@@ -386,7 +386,7 @@ Test cases can also have a `[out]` section, which specifies the
386386
expected contents of stdout the test case should produce. New test
387387
cases should prefer assert statements to `[out]` sections.
388388

389-
### Debuggging Segfaults
389+
### Debugging Segfaults
390390

391391
If you experience a segfault, it's recommended to use a debugger that supports
392392
C, such as gdb or lldb, to look into the segfault.
@@ -409,7 +409,7 @@ Program received signal SIGSEGV, Segmentation fault.
409409
```
410410

411411
You must use `-n0 -s` to enable interactive input to the debugger.
412-
Instad of `gdb`, you can also try `lldb` (especially on macOS).
412+
Instead of `gdb`, you can also try `lldb` (especially on macOS).
413413

414414
To get better C stack tracebacks and more assertions in the Python
415415
runtime, you can build Python in debug mode and use that to run tests,

mypyc/irbuild/prebuildvisitor.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ def __init__(
7373
self.decorators_to_remove: dict[FuncDef, list[int]] = decorators_to_remove
7474

7575
# A mapping of import groups (a series of Import nodes with
76-
# nothing inbetween) where each group is keyed by its first
76+
# nothing in between) where each group is keyed by its first
7777
# import node.
7878
self.module_import_groups: dict[Import, list[Import]] = {}
7979
self._current_import_group: Import | None = None

mypyc/test/test_run.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,7 @@ def run_case_step(self, testcase: DataDrivenTestCase, incremental_step: int) ->
344344
f'hint: Use "pytest -n0 -s --mypyc-debug={debugger} -k <name-substring>" to run test in debugger'
345345
)
346346
print("hint: You may need to build a debug version of Python first and use it")
347-
print('hint: See also "Debuggging Segfaults" in mypyc/doc/dev-intro.md')
347+
print('hint: See also "Debugging Segfaults" in mypyc/doc/dev-intro.md')
348348
copy_output_files(mypyc_output_dir)
349349

350350
# Verify output.

test-data/unit/stubgen.test

+1-1
Original file line numberDiff line numberDiff line change
@@ -4270,7 +4270,7 @@ class Y(missing.Base):
42704270
generated_kwargs_: float
42714271

42724272
[case testDataclassTransform]
4273-
# dataclass_transform detection only works with sementic analysis.
4273+
# dataclass_transform detection only works with semantic analysis.
42744274
# Test stubgen doesn't break too badly without it.
42754275
from typing_extensions import dataclass_transform
42764276

0 commit comments

Comments
 (0)