Skip to content

Commit

Permalink
spelling fixes (python#1499)
Browse files Browse the repository at this point in the history
  • Loading branch information
jsoref authored and gvanrossum committed May 6, 2016
1 parent 7612a9a commit 57359c1
Show file tree
Hide file tree
Showing 33 changed files with 46 additions and 46 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ python:
- "3.3"
- "3.4"
- "3.5"
# Pypy build is disaabled because it doubles the travis build time, and it rarely fails
# Pypy build is disabled because it doubles the travis build time, and it rarely fails
# unless one one of the other builds fails.
# - "pypy3"

Expand Down
2 changes: 1 addition & 1 deletion docs/source/faq.rst
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ differently:
inference which is very slow, does not scale well to large programs
and often produces confusing error messages. Mypy can support
modularity since it only uses local type inference; static type
checking depends on having type annotatations for functions
checking depends on having type annotations for functions
signatures.

- Mypy will support introspection, dynamic loading of code and many
Expand Down
2 changes: 1 addition & 1 deletion docs/source/kinds_of_types.rst
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ values, in callable types. These cover the vast majority of uses of
callable types, but sometimes this isn't quite enough. Mypy recognizes
a special form ``Callable[..., T]`` (with a literal ``...``) which can
be used in less typical cases. It is compatible with arbitrary
callable objects that return a type compatible with ``T``, independend
callable objects that return a type compatible with ``T``, independent
of the number, types or kinds of arguments. Mypy lets you call such
callable values with arbitrary arguments, without any checking -- in
this respect they are treated similar to a ``(*args: Any, **kwargs:
Expand Down
2 changes: 1 addition & 1 deletion lib-typing/2.7/test_typing.py
Original file line number Diff line number Diff line change
Expand Up @@ -796,7 +796,7 @@ def test_invariance(self):
typing.MutableSequence[Employee])

def test_covariance_tuple(self):
# Check covariace for Tuple (which are really special cases).
# Check covariance for Tuple (which are really special cases).
self.assertIsSubclass(Tuple[Manager], Tuple[Employee])
self.assertNotIsSubclass(Tuple[Employee], Tuple[Manager])
# And pairwise.
Expand Down
2 changes: 1 addition & 1 deletion lib-typing/3.2/test_typing.py
Original file line number Diff line number Diff line change
Expand Up @@ -821,7 +821,7 @@ def test_invariance(self):
typing.MutableSequence[Employee])

def test_covariance_tuple(self):
# Check covariace for Tuple (which are really special cases).
# Check covariance for Tuple (which are really special cases).
self.assertIsSubclass(Tuple[Manager], Tuple[Employee])
self.assertNotIsSubclass(Tuple[Employee], Tuple[Manager])
# And pairwise.
Expand Down
2 changes: 1 addition & 1 deletion mypy/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -839,7 +839,7 @@ def write_cache(id: str, path: str, tree: MypyFile,
deserialize the cache data and fix up cross-references. Otherwise, we
do semantic analysis followed by type checking. We also handle (c)
above; if a module has valid cache data *but* any of its
dependendencies was processed from source, then the module should be
dependencies was processed from source, then the module should be
processed from source.
A relatively simple optimization (outside SCCs) we might do in the
Expand Down
2 changes: 1 addition & 1 deletion mypy/checker.py
Original file line number Diff line number Diff line change
Expand Up @@ -938,7 +938,7 @@ def check_method_or_accessor_override_for_base(self, defn: FuncBase,
if name in nodes.inplace_operator_methods:
# Figure out the name of the corresponding operator method.
method = '__' + name[3:]
# An inplace overator method such as __iadd__ might not be
# An inplace operator method such as __iadd__ might not be
# always introduced safely if a base class defined __add__.
# TODO can't come up with an example where this is
# necessary; now it's "just in case"
Expand Down
6 changes: 3 additions & 3 deletions mypy/checkexpr.py
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ def infer_function_type_arguments_using_context(
# See also github issues #462 and #360.
ret_type = NoneTyp()
args = infer_type_arguments(callable.type_var_ids(), ret_type, erased_ctx)
# Only substite non-None and non-erased types.
# Only substitute non-None and non-erased types.
new_args = [] # type: List[Type]
for arg in args:
if isinstance(arg, NoneTyp) or has_erased_component(arg):
Expand Down Expand Up @@ -1643,15 +1643,15 @@ def overload_arg_similarity(actual: Type, formal: Type) -> int:
Return a similarity level:
0: no match
1: actual is compatible, but only using type promitions (e.g. int vs float)
1: actual is compatible, but only using type promotions (e.g. int vs float)
2: actual is compatible without type promotions (e.g. int vs object)
The distinction is important in cases where multiple overload items match. We want
give priority to higher similarity matches.
"""
# Replace type variables with their upper bounds. Overloading
# resolution is based on runtime behavior which erases type
# parameters, so no need to handle type variables occuring within
# parameters, so no need to handle type variables occurring within
# a type.
if isinstance(actual, TypeVarType):
actual = actual.erase_to_union_or_bound()
Expand Down
2 changes: 1 addition & 1 deletion mypy/checkmember.py
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,7 @@ def map_type_from_supertype(typ: Type, sub_info: TypeInfo,
inst_type = map_instance_to_supertype(inst_type, super_info)
# Finally expand the type variables in type with those in the previously
# constructed type. Note that both type and inst_type may have type
# variables, but in type they are interpreterd in supertype context while
# variables, but in type they are interpreted in supertype context while
# in inst_type they are interpreted in subtype context. This works even if
# the names of type variables in supertype and subtype overlap.
return expand_type_by_instance(typ, inst_type)
2 changes: 1 addition & 1 deletion mypy/checkstrformat.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def has_star(self):


class StringFormatterChecker:
"""String interplation/formatter type checker.
"""String interpolation/formatter type checker.
This class works closely together with checker.ExpressionChecker.
"""
Expand Down
4 changes: 2 additions & 2 deletions mypy/meet.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def is_overlapping_types(t: Type, s: Type, use_promotions: bool = False) -> bool
variables are erased at runtime and the overlapping check is based
on runtime behavior.
If use_promitions is True, also consider type promotions (int and
If use_promotions is True, also consider type promotions (int and
float would only be overlapping if it's True).
This does not consider multiple inheritance. For example, A and B in
Expand All @@ -55,7 +55,7 @@ class B: ...
class C(A, B): ...
The rationale is that this case is usually very unlikely as multiple
inhreitance is rare. Also, we can't reliably determine whether
inheritance is rare. Also, we can't reliably determine whether
multiple inheritance actually occurs somewhere in a program, due to
stub files hiding implementation details, dynamic loading etc.
Expand Down
2 changes: 1 addition & 1 deletion mypy/messages.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ def format_distinctly(self, type1: Type, type2: Type) -> Tuple[str, str]:
# Specific operations
#

# The following operations are for genering specific error messages. They
# The following operations are for generating specific error messages. They
# get some information as arguments, and they build an error message based
# on them.

Expand Down
2 changes: 1 addition & 1 deletion mypy/nodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -719,7 +719,7 @@ def accept(self, visitor: NodeVisitor[T]) -> T:


class ExpressionStmt(Node):
"""An expression as a statament, such as print(s)."""
"""An expression as a statement, such as print(s)."""
expr = None # type: Node

def __init__(self, expr: Node) -> None:
Expand Down
2 changes: 1 addition & 1 deletion mypy/parse.py
Original file line number Diff line number Diff line change
Expand Up @@ -1285,7 +1285,7 @@ def parse_expression(self, prec: int = 0, star_expr_allowed: bool = False) -> No
# that in expr.
s = self.current_str()
if s == '(':
# Parerenthesised expression or cast.
# Parenthesised expression or cast.
expr = self.parse_parentheses()
elif s == '[':
expr = self.parse_list_expr()
Expand Down
2 changes: 1 addition & 1 deletion mypy/replacetvars.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def replace_type_vars(typ: Type, func_tvars: bool = True) -> Type:


class ReplaceTypeVarsVisitor(TypeTranslator):
# Only override type variable handling; otherwise perform an indentity
# Only override type variable handling; otherwise perform an identity
# transformation.

func_tvars = False
Expand Down
8 changes: 4 additions & 4 deletions mypy/semanal.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ class SemanticAnalyzer(NodeVisitor):
type_stack = None # type: List[TypeInfo]
# Type variables that are bound by the directly enclosing class
bound_tvars = None # type: List[SymbolTableNode]
# Stack of type varialbes that were bound by outer classess
# Stack of type variables that were bound by outer classess
tvar_stack = None # type: List[List[SymbolTableNode]]

# Stack of functions being analyzed
Expand Down Expand Up @@ -328,7 +328,7 @@ def prepare_method_signature(self, func: FuncDef) -> None:
def is_conditional_func(self, previous: Node, new: FuncDef) -> bool:
"""Does 'new' conditionally redefine 'previous'?
We reject straight redefinitions of functions, as they are usuallly
We reject straight redefinitions of functions, as they are usually
a programming error. For example:
. def f(): ...
Expand Down Expand Up @@ -427,7 +427,7 @@ def visit_overloaded_func_def(self, defn: OverloadedFuncDef) -> None:
self.add_local(defn, defn)

def analyze_property_with_multi_part_definition(self, defn: OverloadedFuncDef) -> None:
"""Analyze a propery defined using multiple methods (e.g., using @x.setter).
"""Analyze a property defined using multiple methods (e.g., using @x.setter).
Assume that the first method (@property) has already been analyzed.
"""
Expand Down Expand Up @@ -730,7 +730,7 @@ def setup_class_def_analysis(self, defn: ClassDef) -> None:
def analyze_base_classes(self, defn: ClassDef) -> None:
"""Analyze and set up base classes."""
for base_expr in defn.base_type_exprs:
# The base class is originallly an expression; convert it to a type.
# The base class is originally an expression; convert it to a type.
try:
base = self.expr_to_analyzed_type(base_expr)
except TypeTranslationError:
Expand Down
2 changes: 1 addition & 1 deletion mypy/solve.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def solve_constraints(vars: List[int], constraints: List[Constraint],
bottom = None # type: Type
top = None # type: Type

# Process each contraint separely, and calculate the lower and upper
# Process each constraint separately, and calculate the lower and upper
# bounds based on constraints. Note that we assume that the constraint
# targets do not have constraint references.
for c in cmap.get(tvar, []):
Expand Down
6 changes: 3 additions & 3 deletions mypy/test/data/check-classes.test
Original file line number Diff line number Diff line change
Expand Up @@ -1042,7 +1042,7 @@ class B(A):
main: note: In class "B":
main:8: error: Signature of "__add__" incompatible with supertype "A"

[case testReverseOperatorMethoddArgumentType]
[case testReverseOperatorMethodArgumentType]
from typing import Any
class A: pass
class B:
Expand All @@ -1053,7 +1053,7 @@ class D:
def __radd__(self, x: A) -> object: pass
[out]

[case testReverseOperatorMethoddArgumentType2]
[case testReverseOperatorMethodArgumentType2]
from typing import Any, Tuple, Callable
class A:
def __radd__(self, x: Tuple[int, str]) -> int: pass
Expand Down Expand Up @@ -1402,7 +1402,7 @@ f(A) # E: Argument 1 to "f" has incompatible type "A" (type object); expected "A
-- refer to attribute before type has been inferred (the initialization in
-- __init__ has not been analyzed)

[case testAnyBaseClassUnconstrainsConstructor]
[case testAnyBaseClassUnconstrainedConstructor]
from typing import Any
B = None # type: Any
class C(B): pass
Expand Down
2 changes: 1 addition & 1 deletion mypy/test/data/check-expressions.test
Original file line number Diff line number Diff line change
Expand Up @@ -959,7 +959,7 @@ a = None # type: Any
'%*.*f' % (4, 2, 3.14)
[builtins fixtures/primitives.py]

[case testStringInterpolationFlagsAndLengthModifers]
[case testStringInterpolationFlagsAndLengthModifiers]
'%04hd' % 1
'%-.4ld' % 1
'%+*Ld' % (1, 1)
Expand Down
4 changes: 2 additions & 2 deletions mypy/test/data/check-generic-subtyping.test
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,7 @@ main: note: In class "A":
-- ------------------------------------------------


[case testSubclassingGenenericABCWithDeepHierarchy]
[case testSubclassingGenericABCWithDeepHierarchy]
from typing import Any, TypeVar, Generic
from abc import abstractmethod
T = TypeVar('T')
Expand Down Expand Up @@ -525,7 +525,7 @@ class D: pass
main:7: error: Incompatible types in assignment (expression has type "A", variable has type I[D])
main: note: In class "A":

[case testSubclassingGenenericABCWithDeepHierarchy2]
[case testSubclassingGenericABCWithDeepHierarchy2]
from typing import Any, TypeVar, Generic
from abc import abstractmethod
T = TypeVar('T')
Expand Down
4 changes: 2 additions & 2 deletions mypy/test/data/check-generics.test
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,7 @@ main:5: error: Generic type is prohibited as a runtime expression (use a type al
-- ------------------------------


[case testMultipleAsssignmentWithLists]
[case testMultipleAssignmentWithLists]
from typing import List
class A: pass
class B: pass
Expand Down Expand Up @@ -506,7 +506,7 @@ class tuple: pass
class function: pass
class str: pass

[case testMultipleAsssignmentWithIterable]
[case testMultipleAssignmentWithIterable]
from typing import Iterable, TypeVar
a = None # type: int
b = None # type: str
Expand Down
2 changes: 1 addition & 1 deletion mypy/test/data/check-inference.test
Original file line number Diff line number Diff line change
Expand Up @@ -1711,7 +1711,7 @@ a2 = C() if f() else B()
a2.foo()

[case testUnificationMultipleInheritanceAmbiguous]
# Show that join_instances_via_supertype() breakes ties using the first base class.
# Show that join_instances_via_supertype() breaks ties using the first base class.
class A1: pass
class B1:
def foo1(self): pass
Expand Down
2 changes: 1 addition & 1 deletion mypy/test/data/check-lists.test
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class C: pass
[builtins fixtures/list.py]
[out]

[case testNestedListAssignmenToTuple]
[case testNestedListAssignmentToTuple]
from typing import List
a, b, c = None, None, None # type: (A, B, C)

Expand Down
2 changes: 1 addition & 1 deletion mypy/test/data/check-python2.test
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ s = A() / 1
s = ''
s = 1 # E: Incompatible types in assignment (expression has type "int", variable has type "str")

[case testStrUnicodeCompatiblity]
[case testStrUnicodeCompatibility]
import typing
def f(x: unicode) -> None: pass
f('')
Expand Down
2 changes: 1 addition & 1 deletion mypy/test/data/pythoneval-asyncio.test
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ def got_result(future: 'Future[str]') -> None:
loop = asyncio.get_event_loop() # type: AbstractEventLoop
future = asyncio.Future() # type: Future[str]
asyncio.Task(slow_operation(future)) # Here create a task with the function. (The Task need a Future[T] as first argument)
future.add_done_callback(got_result) # and assignt the callback to the future
future.add_done_callback(got_result) # and assign the callback to the future
try:
loop.run_forever()
finally:
Expand Down
4 changes: 2 additions & 2 deletions mypy/test/data/stubgen.test
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def g(arg):
def f(a, b): ...
def g(arg): ...

[case testDefaltArgInt]
[case testDefaultArgInt]
def f(a, b=2): ...
def g(b=-1, c=0): ...
[out]
Expand Down Expand Up @@ -260,7 +260,7 @@ class B(ValueError): ...
class A(Exception): ...
class B(ValueError): ...

[case testOmitSomeSpecialMethos]
[case testOmitSomeSpecialMethods]
class A:
def __str__(self): ...
def __repr__(self): ...
Expand Down
2 changes: 1 addition & 1 deletion mypy/test/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def assert_string_arrays_equal(expected: List[str], actual: List[str],
# Keep track of the first different line.
first_diff = -1

# Display only this many first characers of identical lines.
# Display only this many first characters of identical lines.
width = 75

for i in range(num_skip_start, len(expected) - num_skip_end):
Expand Down
2 changes: 1 addition & 1 deletion mypy/test/testcheck.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ def find_missing_cache_files(self, modules: Dict[str, str],
def parse_options(self, program_text: str) -> Tuple[str, str, str]:
"""Return type check options for a test case.
The default ('__main__') module name can be overriden by
The default ('__main__') module name can be overridden by
using a comment like this in the test case input:
# cmd: mypy -m foo.bar
Expand Down
2 changes: 1 addition & 1 deletion mypy/test/testcmdline.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def test_python_evaluation(testcase: DataDrivenTestCase) -> None:


def parse_args(line: str) -> List[str]:
"""Parse the first line of the proram for the command line.
"""Parse the first line of the program for the command line.
This should have the form
Expand Down
6 changes: 3 additions & 3 deletions mypy/traverser.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@
class TraverserVisitor(NodeVisitor[T], Generic[T]):
"""A parse tree visitor that traverses the parse tree during visiting.
It does not peform any actions outside the travelsal. Subclasses
It does not peform any actions outside the traversal. Subclasses
should override visit methods to perform actions during
travelsal. Calling the superclass method allows reusing the
travelsal implementation.
traversal. Calling the superclass method allows reusing the
traversal implementation.
"""

# Visit methods
Expand Down
2 changes: 1 addition & 1 deletion mypy/typeanal.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ class TypeAnalyserPass3(TypeVisitor[None]):
Perform these operations:
* Report error for invalid type argument counts, such as List[x, y].
* Make implicit Any type argumenents explicit my modifying types
* Make implicit Any type arguments explicit my modifying types
in-place. For example, modify Foo into Foo[Any] if Foo expects a single
type argument.
* If a type variable has a value restriction, ensure that the value is
Expand Down
2 changes: 1 addition & 1 deletion pinfer/README
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Introduction
Pinfer is tool for runtime type inference of variable types and
function signatures in Python programs. The inferred types are mostly
compatible with mypy types. It is intended for coming up with draft
types when migrating Python code to static tryping, but it can also be
types when migrating Python code to static typing, but it can also be
used as a code understanding or analysis tool.

Pinfer is very experimental!
Expand Down
Loading

0 comments on commit 57359c1

Please sign in to comment.