def test_slots(self):
        """
        Try to rebuild a new style class with slots defined.
        """
        classDefinition = (
            "class SlottedClass(object):\n"
            "    __slots__ = ['a']\n")

        exec(classDefinition, self.m.__dict__)
        inst = self.m.SlottedClass()
        inst.a = 7
        exec(classDefinition, self.m.__dict__)
        rebuild.updateInstance(inst)
        self.assertEqual(inst.a, 7)
        self.assertIs(type(inst), self.m.SlottedClass)

        Try to rebuild a new style class with slots defined.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/test/test_rebuild.py