def test_typeSubclass(self):
        """
        Try to rebuild a base type subclass.
        """
        classDefinition = (
            "class ListSubclass(list):\n"
            "    pass\n")

        exec(classDefinition, self.m.__dict__)
        inst = self.m.ListSubclass()
        inst.append(2)
        exec(classDefinition, self.m.__dict__)
        rebuild.updateInstance(inst)
        self.assertEqual(inst[0], 2)
        self.assertIs(type(inst), self.m.ListSubclass)

        Try to rebuild a base type subclass.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/test/test_rebuild.py