Skip to content
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

Fix typos in comments. #10459

Merged
merged 2 commits into from
May 12, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
4 changes: 2 additions & 2 deletions mypy/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -1741,7 +1741,7 @@ class State:
# iteration over dependencies.
# They should be managed with add_dependency and suppress_dependency.
dependencies = None # type: List[str] # Modules directly imported by the module
dependencies_set = None # type: Set[str] # The same but as a set for deduplication purposes
dependencies_set = None # type: Set[str] # The same but as a set for duplication purposes
ArjunSahlot marked this conversation as resolved.
Show resolved Hide resolved
suppressed = None # type: List[str] # Suppressed/missing dependencies
suppressed_set = None # type: Set[str] # Suppressed/missing dependencies
priorities = None # type: Dict[str, int]
Expand Down Expand Up @@ -2098,7 +2098,7 @@ def semantic_analysis_pass1(self) -> None:
analyzer = SemanticAnalyzerPreAnalysis()
with self.wrap_context():
analyzer.visit_file(self.tree, self.xpath, self.id, options)
# TODO: Do this while contructing the AST?
# TODO: Do this while constructing the AST?
self.tree.names = SymbolTable()
if options.allow_redefinition:
# Perform renaming across the AST to allow variable redefinitions
Expand Down
10 changes: 5 additions & 5 deletions mypy/checker.py
Original file line number Diff line number Diff line change
Expand Up @@ -2188,7 +2188,7 @@ def try_infer_partial_generic_type_from_assignment(self,
if op != '=' and (typ.type.fullname, op) not in self.partial_type_augmented_ops:
return
# TODO: some logic here duplicates the None partial type counterpart
# inlined in check_assignment(), see # 8043.
# inlined in check_assignment(), see #8043 (https://github.com/python/mypy/issues/8043).
ArjunSahlot marked this conversation as resolved.
Show resolved Hide resolved
partial_types = self.find_partial_types(var)
if partial_types is None:
return
Expand Down Expand Up @@ -2905,7 +2905,7 @@ def infer_partial_type(self, name: Var, lvalue: Lvalue, init_type: Type) -> bool
return True

def is_valid_defaultdict_partial_value_type(self, t: ProperType) -> bool:
"""Check if t can be used as the basis for a partial defaultddict value type.
"""Check if t can be used as the basis for a partial defaultdict value type.

Examples:

Expand Down Expand Up @@ -4499,15 +4499,15 @@ def refine_identity_comparison_expression(self,
if target is None:
return {}, {}

# If possible, use an unassignable expression as the target.
# If possible, use an nonassignable expression as the target.
ArjunSahlot marked this conversation as resolved.
Show resolved Hide resolved
# We skip refining the type of the target below, so ideally we'd
# want to pick an expression we were going to skip anyways.
singleton_index = -1
for i in possible_target_indices:
if i not in narrowable_operand_indices:
singleton_index = i

# But if none of the possible singletons are unassignable ones, we give up
# But if none of the possible singletons are nonassignable ones, we give up
ArjunSahlot marked this conversation as resolved.
Show resolved Hide resolved
# and arbitrarily pick the last item, mostly because other parts of the
# type narrowing logic bias towards picking the rightmost item and it'd be
# nice to stay consistent.
Expand Down Expand Up @@ -5477,7 +5477,7 @@ def overload_can_never_match(signature: CallableType, other: CallableType) -> bo


def is_more_general_arg_prefix(t: FunctionLike, s: FunctionLike) -> bool:
"""Does t have wider arguments than s?"""
"""Does it have wider arguments than s?"""
ArjunSahlot marked this conversation as resolved.
Show resolved Hide resolved
# TODO should an overload with additional items be allowed to be more
# general than one with fewer items (or just one item)?
if isinstance(t, CallableType):
Expand Down
2 changes: 1 addition & 1 deletion mypy/checkexpr.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
MAX_UNIONS = 5 # type: Final


# Types considered safe for comparisons with --strict-equality due to known behaviour of __eq__.
# Types considered safe for comparisons with --strict-equality due to known behavior of __eq__.
ArjunSahlot marked this conversation as resolved.
Show resolved Hide resolved
# NOTE: All these types are subtypes of AbstractSet.
OVERLAPPING_TYPES_WHITELIST = ['builtins.set', 'builtins.frozenset',
'typing.KeysView', 'typing.ItemsView'] # type: Final
Expand Down