If an exception is raised during initialization __del__ is still called so that the class can clean up after it self. In that case the _is_reference attribute may not have been set.