Skip to content

Fix spelling #18642

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 9, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/source/generics.rst
Original file line number Diff line number Diff line change
Expand Up @@ -999,7 +999,7 @@ similarly supported via generics (Python 3.12 syntax):

.. code-block:: python

from colletions.abc import Callable
from collections.abc import Callable
from typing import Any

def route[F: Callable[..., Any]](url: str) -> Callable[[F], F]:
Expand Down
2 changes: 1 addition & 1 deletion docs/source/more_types.rst
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ program:
The ``summarize([])`` call matches both variants: an empty list could
be either a ``list[int]`` or a ``list[str]``. In this case, mypy
will break the tie by picking the first matching variant: ``output``
will have an inferred type of ``float``. The implementor is responsible
will have an inferred type of ``float``. The implementer is responsible
for making sure ``summarize`` breaks ties in the same way at runtime.

However, there are two exceptions to the "pick the first match" rule.
Expand Down
2 changes: 1 addition & 1 deletion docs/source/runtime_troubles.rst
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ libraries if types are generic only in stubs.
Using types defined in stubs but not at runtime
-----------------------------------------------

Sometimes stubs that you're using may define types you wish to re-use that do
Sometimes stubs that you're using may define types you wish to reuse that do
not exist at runtime. Importing these types naively will cause your code to fail
at runtime with ``ImportError`` or ``ModuleNotFoundError``. Similar to previous
sections, these can be dealt with by using :ref:`typing.TYPE_CHECKING
Expand Down
2 changes: 1 addition & 1 deletion mypy/argmap.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ def expand_actual_type(
self.tuple_index += 1
item = actual_type.items[self.tuple_index - 1]
if isinstance(item, UnpackType) and not allow_unpack:
# An upack item that doesn't have special handling, use upper bound as above.
# An unpack item that doesn't have special handling, use upper bound as above.
unpacked = get_proper_type(item.type)
if isinstance(unpacked, TypeVarTupleType):
fallback = get_proper_type(unpacked.upper_bound)
Expand Down
2 changes: 1 addition & 1 deletion mypy/checkexpr.py
Original file line number Diff line number Diff line change
Expand Up @@ -3184,7 +3184,7 @@ def combine_function_signatures(self, types: list[ProperType]) -> AnyType | Call
new_type_narrowers.append(target.type_is)

if new_type_guards and new_type_narrowers:
# They cannot be definined at the same time,
# They cannot be defined at the same time,
# declaring this function as too complex!
too_complex = True
union_type_guard = None
Expand Down
2 changes: 1 addition & 1 deletion mypy/constraints.py
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ def _infer_constraints(
res = []
for a_item in actual.items:
# `orig_template` has to be preserved intact in case it's recursive.
# If we unwraped ``type[...]`` previously, wrap the item back again,
# If we unwrapped ``type[...]`` previously, wrap the item back again,
# as ``type[...]`` can't be removed from `orig_template`.
if type_type_unwrapped:
a_item = TypeType.make_normalized(a_item)
Expand Down
2 changes: 1 addition & 1 deletion mypy/inspections.py
Original file line number Diff line number Diff line change
Expand Up @@ -564,7 +564,7 @@ def run_inspection(
) -> dict[str, object]:
"""Top-level logic to inspect expression(s) at a location.

This can be re-used by various simple inspections.
This can be reused by various simple inspections.
"""
try:
file, pos = parse_location(location)
Expand Down
2 changes: 1 addition & 1 deletion mypy/join.py
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@ def join_tuples(self, s: TupleType, t: TupleType) -> list[Type] | None:
return items
return None
if s_unpack_index is not None and t_unpack_index is not None:
# The most complex case: both tuples have an upack item.
# The most complex case: both tuples have an unpack item.
s_unpack = s.items[s_unpack_index]
assert isinstance(s_unpack, UnpackType)
s_unpacked = get_proper_type(s_unpack.type)
Expand Down
2 changes: 1 addition & 1 deletion mypy/messages.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ def are_type_names_disabled(self) -> bool:
def prefer_simple_messages(self) -> bool:
"""Should we generate simple/fast error messages?

If errors aren't shown to the user, we don't want to waste cyles producing
If errors aren't shown to the user, we don't want to waste cycles producing
complex error messages.
"""
return self.errors.prefer_simple_messages()
Expand Down
2 changes: 1 addition & 1 deletion mypy/semanal_namedtuple.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ def check_namedtuple_classdef(
# Something is incomplete. We need to defer this named tuple.
return None
types.append(analyzed)
# ...despite possible minor failures that allow further analyzis.
# ...despite possible minor failures that allow further analysis.
if name.startswith("_"):
self.fail(
f"NamedTuple field name cannot start with an underscore: {name}", stmt
Expand Down
2 changes: 1 addition & 1 deletion mypy/semanal_newtype.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ def analyze_newtype_declaration(self, s: AssignmentStmt) -> tuple[str | None, Ca
def check_newtype_args(
self, name: str, call: CallExpr, context: Context
) -> tuple[Type | None, bool]:
"""Ananlyze base type in NewType call.
"""Analyze base type in NewType call.

Return a tuple (type, should defer).
"""
Expand Down
2 changes: 1 addition & 1 deletion mypy/stubgenc.py
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ def get_pos_default(i: int, _arg: str) -> Any | None:
# Add *args if present
if varargs:
arglist.append(ArgSig(f"*{varargs}", get_annotation(varargs)))
# if we have keyword only args, then wee need to add "*"
# if we have keyword only args, then we need to add "*"
elif kwonlyargs:
arglist.append(ArgSig("*"))

Expand Down
2 changes: 1 addition & 1 deletion mypy/suggestions.py
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,7 @@ def get_guesses_from_parent(self, node: FuncDef) -> list[CallableType]:
pnode = parent.names.get(node.name)
if pnode and isinstance(pnode.node, (FuncDef, Decorator)):
typ = get_proper_type(pnode.node.type)
# FIXME: Doesn't work right with generic tyeps
# FIXME: Doesn't work right with generic types
if isinstance(typ, CallableType) and len(typ.arg_types) == len(node.arguments):
# Return the first thing we find, since it probably doesn't make sense
# to grab things further up in the chain if an earlier parent has it.
Expand Down
4 changes: 2 additions & 2 deletions mypy/type_visitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ class TypeQuery(SyntheticTypeVisitor[T]):
common use cases involve a boolean query using `any` or `all`.

Note: this visitor keeps an internal state (tracks type aliases to avoid
recursion), so it should *never* be re-used for querying different types,
recursion), so it should *never* be reused for querying different types,
create a new visitor instance instead.

# TODO: check that we don't have existing violations of this rule.
Expand Down Expand Up @@ -467,7 +467,7 @@ class BoolTypeQuery(SyntheticTypeVisitor[bool]):
be ANY_STRATEGY or ALL_STRATEGY.

Note: This visitor keeps an internal state (tracks type aliases to avoid
recursion), so it should *never* be re-used for querying different types
recursion), so it should *never* be reused for querying different types
unless you call reset() first.
"""

Expand Down
2 changes: 1 addition & 1 deletion mypyc/codegen/emitfunc.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ def generate_native_function(
# generates them will add instructions between the branch and the
# next label, causing the label to be wrongly removed. A better
# solution would be to change the IR so that it adds a basic block
# inbetween the calls.
# in between the calls.
is_problematic_op = isinstance(terminator, Branch) and any(
isinstance(s, GetAttr) for s in terminator.sources()
)
Expand Down
8 changes: 4 additions & 4 deletions mypyc/doc/dev-intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ pretty-printed IR into `build/ops.txt`. This is the final IR that
includes the output from exception and reference count handling
insertion passes.

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

## Type-checking Mypyc
Expand Down Expand Up @@ -290,7 +290,7 @@ under `mypyc/lib-rt`.

## Inspecting Generated C

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

### Debuggging Segfaults
### Debugging Segfaults

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

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

To get better C stack tracebacks and more assertions in the Python
runtime, you can build Python in debug mode and use that to run tests,
Expand Down
2 changes: 1 addition & 1 deletion mypyc/irbuild/prebuildvisitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def __init__(
self.decorators_to_remove: dict[FuncDef, list[int]] = decorators_to_remove

# A mapping of import groups (a series of Import nodes with
# nothing inbetween) where each group is keyed by its first
# nothing in between) where each group is keyed by its first
# import node.
self.module_import_groups: dict[Import, list[Import]] = {}
self._current_import_group: Import | None = None
Expand Down
2 changes: 1 addition & 1 deletion mypyc/test/test_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ def run_case_step(self, testcase: DataDrivenTestCase, incremental_step: int) ->
f'hint: Use "pytest -n0 -s --mypyc-debug={debugger} -k <name-substring>" to run test in debugger'
)
print("hint: You may need to build a debug version of Python first and use it")
print('hint: See also "Debuggging Segfaults" in mypyc/doc/dev-intro.md')
print('hint: See also "Debugging Segfaults" in mypyc/doc/dev-intro.md')
copy_output_files(mypyc_output_dir)

# Verify output.
Expand Down
2 changes: 1 addition & 1 deletion test-data/unit/stubgen.test
Original file line number Diff line number Diff line change
Expand Up @@ -4270,7 +4270,7 @@ class Y(missing.Base):
generated_kwargs_: float

[case testDataclassTransform]
# dataclass_transform detection only works with sementic analysis.
# dataclass_transform detection only works with semantic analysis.
# Test stubgen doesn't break too badly without it.
from typing_extensions import dataclass_transform

Expand Down