Skip to content

Commit 300c846

Browse files
scopJukkaL
authored andcommitted
Spelling and grammar fixes (#8194)
1 parent 9756b59 commit 300c846

18 files changed

+27
-27
lines changed

mypy/build.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -968,7 +968,7 @@ def write_plugins_snapshot(manager: BuildManager) -> None:
968968
def read_plugins_snapshot(manager: BuildManager) -> Optional[Dict[str, str]]:
969969
"""Read cached snapshot of versions and hashes of plugins from previous run."""
970970
snapshot = _load_json_file(PLUGIN_SNAPSHOT_FILE, manager,
971-
log_sucess='Plugins snapshot ',
971+
log_success='Plugins snapshot ',
972972
log_error='Could not load plugins snapshot: ')
973973
if snapshot is None:
974974
return None
@@ -1009,7 +1009,7 @@ def read_deps_cache(manager: BuildManager,
10091009
Returns None if the cache was invalid in some way.
10101010
"""
10111011
deps_meta = _load_json_file(DEPS_META_FILE, manager,
1012-
log_sucess='Deps meta ',
1012+
log_success='Deps meta ',
10131013
log_error='Could not load fine-grained dependency metadata: ')
10141014
if deps_meta is None:
10151015
return None
@@ -1041,7 +1041,7 @@ def read_deps_cache(manager: BuildManager,
10411041

10421042

10431043
def _load_json_file(file: str, manager: BuildManager,
1044-
log_sucess: str, log_error: str) -> Optional[Dict[str, Any]]:
1044+
log_success: str, log_error: str) -> Optional[Dict[str, Any]]:
10451045
"""A simple helper to read a JSON file with logging."""
10461046
t0 = time.time()
10471047
try:
@@ -1052,7 +1052,7 @@ def _load_json_file(file: str, manager: BuildManager,
10521052
manager.add_stats(metastore_read_time=time.time() - t0)
10531053
# Only bother to compute the log message if we are logging it, since it could be big
10541054
if manager.verbosity() >= 2:
1055-
manager.trace(log_sucess + data.rstrip())
1055+
manager.trace(log_success + data.rstrip())
10561056
try:
10571057
result = json.loads(data)
10581058
except ValueError: # TODO: JSONDecodeError in 3.5
@@ -1142,7 +1142,7 @@ def find_cache_meta(id: str, path: str, manager: BuildManager) -> Optional[Cache
11421142
manager.trace('Looking for {} at {}'.format(id, meta_json))
11431143
t0 = time.time()
11441144
meta = _load_json_file(meta_json, manager,
1145-
log_sucess='Meta {} '.format(id),
1145+
log_success='Meta {} '.format(id),
11461146
log_error='Could not load cache for {}: '.format(id))
11471147
t1 = time.time()
11481148
if meta is None:

mypy/checkexpr.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2514,7 +2514,7 @@ def lookup_definer(typ: Instance, attr_name: str) -> Optional[str]:
25142514
variants_raw.append((right_cmp_op, right_type, left_expr))
25152515

25162516
# STEP 3:
2517-
# We now filter out all non-existant operators. The 'variants' list contains
2517+
# We now filter out all non-existent operators. The 'variants' list contains
25182518
# all operator methods that are actually present, in the order that Python
25192519
# attempts to invoke them.
25202520

mypy/checkmember.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -565,7 +565,7 @@ def analyze_var(name: str,
565565
# * B.f: Callable[[B1], None] where B1 <: B (maybe B1 == B)
566566
# * x: Union[A1, B1]
567567
# In `x.f`, when checking `x` against A1 we assume x is compatible with A
568-
# and similarly for B1 when checking agains B
568+
# and similarly for B1 when checking against B
569569
dispatched_type = meet.meet_types(mx.original_type, itype)
570570
signature = freshen_function_type_vars(functype)
571571
signature = check_self_arg(signature, dispatched_type, var.is_classmethod,

mypy/dmypy_server.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ def cmd_status(self, fswatcher_dump_file: Optional[str] = None) -> Dict[str, obj
273273
res.update(get_meminfo())
274274
if fswatcher_dump_file:
275275
data = self.fswatcher.dump_file_data() if hasattr(self, 'fswatcher') else {}
276-
# Using .dumps and then writing was noticably faster than using dump
276+
# Using .dumps and then writing was noticeably faster than using dump
277277
s = json.dumps(data)
278278
with open(fswatcher_dump_file, 'w') as f:
279279
f.write(s)

mypy/fastparse.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1137,7 +1137,7 @@ def visit_JoinedStr(self, n: ast3.JoinedStr) -> Expression:
11371137
empty_string.set_line(n.lineno, n.col_offset)
11381138
strs_to_join = ListExpr(self.translate_expr_list(n.values))
11391139
strs_to_join.set_line(empty_string)
1140-
# Don't make unecessary join call if there is only one str to join
1140+
# Don't make unnecessary join call if there is only one str to join
11411141
if len(strs_to_join.items) == 1:
11421142
return self.set_line(strs_to_join.items[0], n)
11431143
join_method = MemberExpr(empty_string, 'join')

mypy/moduleinspect.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ def _start(self) -> None:
122122
self.results = Queue() # type: Queue[Union[ModuleProperties, str]]
123123
self.proc = Process(target=worker, args=(self.tasks, self.results, sys.path))
124124
self.proc.start()
125-
self.counter = 0 # Number of successfull roundtrips
125+
self.counter = 0 # Number of successful roundtrips
126126

127127
def close(self) -> None:
128128
"""Free any resources used."""

mypy/nodes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -856,7 +856,7 @@ def __init__(self, name: str, type: 'Optional[mypy.types.Type]' = None) -> None:
856856
# def __init__(self) -> None:
857857
# self.x: int
858858
# This case is important because this defines a new Var, even if there is one
859-
# present in a superclass (without explict type this doesn't create a new Var).
859+
# present in a superclass (without explicit type this doesn't create a new Var).
860860
# See SemanticAnalyzer.analyze_member_lvalue() for details.
861861
self.explicit_self_type = False
862862
# If True, this is an implicit Var created due to module-level __getattr__.

mypy/semanal_namedtuple.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ def parse_namedtuple_fields_with_types(self, nodes: List[Expression], context: C
314314
bool]]:
315315
"""Parse typed named tuple fields.
316316
317-
Return (names, types, defaults, error ocurred), or None if at least one of
317+
Return (names, types, defaults, error occurred), or None if at least one of
318318
the types is not ready.
319319
"""
320320
items = [] # type: List[str]

mypy/semanal_shared.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ def calculate_tuple_fallback(typ: TupleType) -> None:
208208
Note that there is an apparent chicken and egg problem with respect
209209
to verifying type arguments against bounds. Verifying bounds might
210210
require fallbacks, but we might use the bounds to calculate the
211-
fallbacks. In partice this is not a problem, since the worst that
211+
fallbacks. In practice this is not a problem, since the worst that
212212
can happen is that we have invalid type argument values, and these
213213
can happen in later stages as well (they will generate errors, but
214214
we don't prevent their existence).

mypy/server/deps.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ def process_type_info(self, info: TypeInfo) -> None:
299299
if name not in info.names:
300300
continue
301301
# __init__ and __new__ can be overridden with different signatures, so no
302-
# logical depedency.
302+
# logical dependency.
303303
if name in ('__init__', '__new__'):
304304
continue
305305
self.add_dependency(make_trigger(base_info.fullname + '.' + name),

mypy/stats.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ def visit_call_expr(self, o: CallExpr) -> None:
227227
def record_call_target_precision(self, o: CallExpr) -> None:
228228
"""Record precision of formal argument types used in a call."""
229229
if not self.typemap or o.callee not in self.typemap:
230-
# Type not availabe.
230+
# Type not available.
231231
return
232232
callee_type = get_proper_type(self.typemap[o.callee])
233233
if isinstance(callee_type, CallableType):

mypy/suggestions.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ def get_args(self, is_method: bool,
305305
"""Produce a list of type suggestions for each argument type."""
306306
types = [] # type: List[List[Type]]
307307
for i in range(len(base.arg_kinds)):
308-
# Make self args Any but this will get overriden somewhere in the checker
308+
# Make self args Any but this will get overridden somewhere in the checker
309309
if i == 0 and is_method:
310310
types.append([AnyType(TypeOfAny.suggestion_engine)])
311311
continue
@@ -967,7 +967,7 @@ def refine_union(t: UnionType, s: ProperType) -> Type:
967967
968968
This is done by refining every component of the union against the
969969
right hand side type (or every component of its union if it is
970-
one). If an element of the union is succesfully refined, we drop it
970+
one). If an element of the union is successfully refined, we drop it
971971
from the union in favor of the refined versions.
972972
"""
973973
# Don't try to do any union refining if the types are already the

mypy/test/helpers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,7 @@ def copy_and_fudge_mtime(source_path: str, target_path: str) -> None:
412412
# In some systems, mtime has a resolution of 1 second which can
413413
# cause annoying-to-debug issues when a file has the same size
414414
# after a change. We manually set the mtime to circumvent this.
415-
# Note that we increment the old file's mtime, which guarentees a
415+
# Note that we increment the old file's mtime, which guarantees a
416416
# different value, rather than incrementing the mtime after the
417417
# copy, which could leave the mtime unchanged if the old file had
418418
# a similarly fudged mtime.

mypyc/emitmodule.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
# modules: one shim per module and one shared library containing all
5454
# the actual code.
5555
# In fully separate compilation, we (unfortunately) will generate 2*N
56-
# extension modules: one shim per module and also one library containg
56+
# extension modules: one shim per module and also one library containing
5757
# each module's actual code. (This might be fixable in the future,
5858
# but allows a clean separation between setup of the export tables
5959
# (see generate_export_table) and running module top levels.)
@@ -424,10 +424,10 @@ def pointerize(decl: str, name: str) -> str:
424424
"""Given a C decl and its name, modify it to be a declaration to a pointer."""
425425
# This doesn't work in general but does work for all our types...
426426
if '(' in decl:
427-
# Function pointer. Stick a * in front of the name and wrap it in parens.
427+
# Function pointer. Stick an * in front of the name and wrap it in parens.
428428
return decl.replace(name, '(*{})'.format(name))
429429
else:
430-
# Non-function pointer. Just stick a * in front of the name.
430+
# Non-function pointer. Just stick an * in front of the name.
431431
return decl.replace(name, '*{}'.format(name))
432432

433433

mypyc/genops.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -601,7 +601,7 @@ def prepare_class_def(path: str, module_name: str, cdef: ClassDef,
601601

602602
# We sort the table for determinism here on Python 3.5
603603
for name, node in sorted(info.names.items()):
604-
# Currenly all plugin generated methods are dummies and not included.
604+
# Currently all plugin generated methods are dummies and not included.
605605
if node.plugin_generated:
606606
continue
607607

@@ -3651,7 +3651,7 @@ def visit_tuple_expr(self, expr: TupleExpr) -> Value:
36513651
# create a tuple of unknown length
36523652
return self._visit_tuple_display(expr)
36533653

3654-
# create an tuple of fixed length (RTuple)
3654+
# create a tuple of fixed length (RTuple)
36553655
tuple_type = self.node_type(expr)
36563656
# When handling NamedTuple et. al we might not have proper type info,
36573657
# so make some up if we need it.

mypyc/test/test_run.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ def get_separate(self, program_text: str,
312312
return True
313313

314314

315-
# Run the main multi-module tests in multi-file compliation mode
315+
# Run the main multi-module tests in multi-file compilation mode
316316
class TestRunMultiFile(TestRun):
317317
multi_file = True
318318
test_name_suffix = '_multi'
@@ -322,7 +322,7 @@ class TestRunMultiFile(TestRun):
322322
]
323323

324324

325-
# Run the main multi-module tests in separate compliation mode
325+
# Run the main multi-module tests in separate compilation mode
326326
class TestRunSeparate(TestRun):
327327
separate = True
328328
test_name_suffix = '_separate'

mypyc/test/test_serialization.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def assert_blobs_same(x: Any, y: Any, trail: Tuple[Any, ...]) -> None:
3333
3434
FuncDecls, FuncIRs, and ClassIRs are compared by fullname to avoid
3535
infinite recursion.
36-
(More detailed comparisions should be done manually.)
36+
(More detailed comparisons should be done manually.)
3737
3838
Types and signatures are compared using mypyc.sametype.
3939

mypyc/uninit.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ def split_blocks_at_uninits(env: Environment,
4141
for i, op in enumerate(ops):
4242
defined = pre_must_defined[block, i]
4343
for src in op.unique_sources():
44-
# If a register operand is not guarenteed to be
44+
# If a register operand is not guaranteed to be
4545
# initialized is an operand to something other than a
4646
# check that it is defined, insert a check.
4747
if (isinstance(src, Register) and src not in defined

0 commit comments

Comments
 (0)