Thanks to visit codestin.com
Credit goes to github.com

Skip to content
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
Prev Previous commit
use member context instead of passing options around, suppress help
  • Loading branch information
koogoro committed Apr 19, 2023
commit d19637f3cda6a6f9765071aab78589c4d462d6fe
6 changes: 1 addition & 5 deletions mypy/checker.py
Original file line number Diff line number Diff line change
Expand Up @@ -688,7 +688,6 @@ def check_overlapping_overloads(self, defn: OverloadedFuncDef) -> None:
msg=self.msg,
original_type=inner_type,
chk=self,
options=self.options,
)
)
if isinstance(inner_call, CallableType):
Expand Down Expand Up @@ -3972,7 +3971,7 @@ def check_member_assignment(
msg=self.msg,
chk=self,
)
get_type = analyze_descriptor_access(attribute_type, mx, self.options)
get_type = analyze_descriptor_access(attribute_type, mx)
if not attribute_type.type.has_readable_member("__set__"):
# If there is no __set__, we type-check that the assigned value matches
# the return type of __get__. This doesn't match the python semantics,
Expand All @@ -3998,7 +3997,6 @@ def check_member_assignment(
self_type=attribute_type,
name="__set__",
mx=mx,
options=self.options,
)
typ = map_instance_to_supertype(attribute_type, dunder_set.info)
dunder_set_type = expand_type_by_instance(bound_method, typ)
Expand Down Expand Up @@ -5713,7 +5711,6 @@ def replay_lookup(new_parent_type: ProperType) -> Type | None:
original_type=new_parent_type,
chk=self,
in_literal_context=False,
options=self.options,
)
if w.has_new_errors():
return None
Expand Down Expand Up @@ -6716,7 +6713,6 @@ def has_valid_attribute(self, typ: Type, name: str) -> bool:
# This is not a real attribute lookup so don't mess with deferring nodes.
no_deferral=True,
module_symbol_table=module_symbol_table,
options=self.options,
)
return not watcher.has_new_errors()

Expand Down
7 changes: 0 additions & 7 deletions mypy/checkexpr.py
Original file line number Diff line number Diff line change
Expand Up @@ -1244,7 +1244,6 @@ def check_union_call_expr(self, e: CallExpr, object_type: UnionType, member: str
chk=self.chk,
in_literal_context=self.is_literal_context(),
self_type=typ,
options=self.chk.options,
)
narrowed = self.narrow_type_from_binder(e.callee, item, skip_non_overlapping=True)
if narrowed is None:
Expand Down Expand Up @@ -1320,7 +1319,6 @@ def check_call(
original_type=callee,
chk=self.chk,
in_literal_context=self.is_literal_context(),
options=self.chk.options,
)
callable_name = callee.type.fullname + ".__call__"
# Apply method signature hook, if one exists
Expand Down Expand Up @@ -2804,7 +2802,6 @@ def analyze_ordinary_member_access(self, e: MemberExpr, is_lvalue: bool) -> Type
in_literal_context=self.is_literal_context(),
module_symbol_table=module_symbol_table,
is_self=is_self,
options=self.chk.options,
)

return member_type
Expand All @@ -2827,7 +2824,6 @@ def analyze_external_member_access(
original_type=base_type,
chk=self.chk,
in_literal_context=self.is_literal_context(),
options=self.chk.options,
)

def is_literal_context(self) -> bool:
Expand Down Expand Up @@ -3217,7 +3213,6 @@ def check_method_call_by_name(
original_type=original_type,
chk=self.chk,
in_literal_context=self.is_literal_context(),
options=self.chk.options,
)
return self.check_method_call(method, base_type, method_type, args, arg_kinds, context)

Expand Down Expand Up @@ -3311,7 +3306,6 @@ def lookup_operator(op_name: str, base_type: Type) -> Type | None:
msg=self.msg,
chk=self.chk,
in_literal_context=self.is_literal_context(),
options=self.chk.options,
)
return None if w.has_new_errors() else member

Expand Down Expand Up @@ -4572,7 +4566,6 @@ def visit_super_expr(self, e: SuperExpr) -> Type:
msg=self.msg,
chk=self.chk,
in_literal_context=self.is_literal_context(),
options=self.chk.options,
)

assert False, "unreachable"
Expand Down
Loading