# Buggy code
def infer_partial_type(self, name: Var, lvalue: Lvalue, init_type: Type) -> bool:
    if isinstance(init_type, (NoneTyp, UninhabitedType)):
        partial_type = PartialType(None, name, [init_type])
    elif isinstance(init_type, Instance):
        fullname = init_type.type.fullname()
        if (
            isinstance(lvalue, NameExpr)
            and (
                fullname == "builtins.list"
                or fullname == "builtins.set"
                or fullname == "builtins.dict"
            )
            and all(isinstance(t, (NoneTyp, UninhabitedType)) for t in init_type.args)
        ):
            partial_type = PartialType(init_type.type, name, init_type.args)
        else:
            return False
    else:
        return False
    self.set_inferred_type(name, lvalue, partial_type)
    self.partial_types[-1][name] = lvalue
    return True


# Traceback (AssertionError)
myfile.py:270: error: INTERNAL ERROR -- please report a bug at https://github.com/python/mypy/issues
Traceback (most recent call last):
File "/usr/lib/python3.4/runpy.py", line 170, in _run_module_as_main
"__main__", mod_spec)
File "/usr/lib/python3.4/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/usr/local/lib/python3.4/dist-packages/mypy/__main__.py", line 5, in <module>
main(None)
File "/usr/local/lib/python3.4/dist-packages/mypy/main.py", line 42, in main
res = type_check_only(sources, bin_dir, options)
File "/usr/local/lib/python3.4/dist-packages/mypy/main.py", line 86, in type_check_only
options=options)
File "/usr/local/lib/python3.4/dist-packages/mypy/build.py", line 183, in build
dispatch(sources, manager)
File "/usr/local/lib/python3.4/dist-packages/mypy/build.py", line 1531, in dispatch
process_graph(graph, manager)
File "/usr/local/lib/python3.4/dist-packages/mypy/build.py", line 1768, in process_graph
process_stale_scc(graph, scc)
File "/usr/local/lib/python3.4/dist-packages/mypy/build.py", line 1847, in process_stale_scc
graph[id].type_check_first_pass()
File "/usr/local/lib/python3.4/dist-packages/mypy/build.py", line 1453, in type_check_first_pass
self.type_checker.check_first_pass()
File "/usr/local/lib/python3.4/dist-packages/mypy/checker.py", line 167, in check_first_pass
self.accept(d)
File "/usr/local/lib/python3.4/dist-packages/mypy/checker.py", line 233, in accept
stmt.accept(self)
File "/usr/local/lib/python3.4/dist-packages/mypy/nodes.py", line 717, in accept
return visitor.visit_class_def(self)
File "/usr/local/lib/python3.4/dist-packages/mypy/checker.py", line 970, in visit_class_def
self.accept(defn.defs)
File "/usr/local/lib/python3.4/dist-packages/mypy/checker.py", line 233, in accept
stmt.accept(self)
File "/usr/local/lib/python3.4/dist-packages/mypy/nodes.py", line 778, in accept
return visitor.visit_block(self)
File "/usr/local/lib/python3.4/dist-packages/mypy/checker.py", line 1063, in visit_block
self.accept(s)
File "/usr/local/lib/python3.4/dist-packages/mypy/checker.py", line 233, in accept
stmt.accept(self)
File "/usr/local/lib/python3.4/dist-packages/mypy/nodes.py", line 601, in accept
return visitor.visit_decorator(self)
File "/usr/local/lib/python3.4/dist-packages/mypy/checker.py", line 2052, in visit_decorator
e.func.accept(self)
File "/usr/local/lib/python3.4/dist-packages/mypy/nodes.py", line 536, in accept
return visitor.visit_func_def(self)
File "/usr/local/lib/python3.4/dist-packages/mypy/checker.py", line 425, in visit_func_def
self.check_method_override(defn)
File "/usr/local/lib/python3.4/dist-packages/mypy/checker.py", line 836, in check_method_override
self.check_method_or_accessor_override_for_base(defn, base)
File "/usr/local/lib/python3.4/dist-packages/mypy/checker.py", line 846, in check_method_or_accessor_override_for_base
self.check_method_override_for_base_with_name(defn, name, base)
File "/usr/local/lib/python3.4/dist-packages/mypy/checker.py", line 874, in check_method_override_for_base_with_name
assert False, str(base_attr.node)
AssertionError: Var(config)

# Fixed code
def infer_partial_type(self, name: Var, lvalue: Lvalue, init_type: Type) -> bool:
    if isinstance(init_type, (NoneTyp, UninhabitedType)):
        partial_type = PartialType(None, name, [init_type])
    elif isinstance(init_type, Instance):
        fullname = init_type.type.fullname()
        if (
            isinstance(lvalue, (NameExpr, MemberExpr))
            and (
                fullname == "builtins.list"
                or fullname == "builtins.set"
                or fullname == "builtins.dict"
            )
            and all(isinstance(t, (NoneTyp, UninhabitedType)) for t in init_type.args)
        ):
            partial_type = PartialType(init_type.type, name, init_type.args)
        else:
            return False
    else:
        return False
    self.set_inferred_type(name, lvalue, partial_type)
    self.partial_types[-1][name] = lvalue
    return True