Hasattr Function In Python With Parameters