import gc def findnulltuple(): result = [] objlist = gc.get_objects() for obj in objlist: if type(obj) is tuple and repr(obj) == '(,)': return obj t = findnulltuple() if t is not None: print(repr(t)) t[0]