o=[v for v in gc.get_objects() if hasattr(v,'navigation_view') and v.navigation_view==nv and not v.superview]
This is probably a place where a list comprehension is not your friend.
v for v in gc.get_objects():
if hasattr(v, 'navigation_view') and v.navigation_view == nv and not v.superview:
return None # explicit is better than implicit
allows you to stop building a list of all gc objects immediately after you have found the one that you want.