code: def _deleteObject(self, xref):
          
          if self.isClosed:
              raise ValueError("operation illegal for closed doc")
  
          return _fitz.Document__deleteObject(self, xref)
docs: Delete an object given its xref.