`outfile[:-len(cls.EXTENTION)]` will do?