I\'m developing an application in which I perform some requests to get an object id. After each one of them, I call a method (get_actor_info()) passing this id
get_actor_info()
Python 3.6 will introduce yet another option:
ACTOR_CACHE_KEY_PREFIX = 'actor_' def get_actor_info(actor_id): cache_key = f'{ACTOR_CACHE_KEY_PREFIX}{actor_id}'
Performance should be comparable to '{}{}'.format(ACTOR_CACHE_KEY_PREFIX, actor_id), but is arguably more readable.
'{}{}'.format(ACTOR_CACHE_KEY_PREFIX, actor_id)