MCPcopy Index your code
hub / github.com/python/mypy / incompatible_conditional_function_def

Method incompatible_conditional_function_def

mypy/messages.py:1568–1578  ·  view source on GitHub ↗
(
        self, defn: FuncDef, old_type: FunctionLike, new_type: FunctionLike
    )

Source from the content-addressed store, hash-verified

1566 )
1567
1568 def incompatible_conditional_function_def(
1569 self, defn: FuncDef, old_type: FunctionLike, new_type: FunctionLike
1570 ) -> None:
1571 error = self.fail("All conditional function variants must have identical signatures", defn)
1572 if isinstance(old_type, (CallableType, Overloaded)) and isinstance(
1573 new_type, (CallableType, Overloaded)
1574 ):
1575 self.note("Original:", defn)
1576 self.pretty_callable_or_overload(old_type, defn, offset=4, parent_error=error)
1577 self.note("Redefinition:", defn)
1578 self.pretty_callable_or_overload(new_type, defn, offset=4, parent_error=error)
1579
1580 def cannot_instantiate_abstract_class(
1581 self, class_name: str, abstract_attributes: dict[str, bool], context: Context

Callers 1

Calls 4

failMethod · 0.95
noteMethod · 0.95
isinstanceFunction · 0.85

Tested by

no test coverage detected