[python] Pythonic way to check if something exists?