I have this class defined:
class Endpoint:
recent_releases = "apps/{owner_name}/{app_name}/recent_releases"
recent_latest = "apps/{owner_name}/{app_name}/releases/{release_id}"
and currently using format()
to format it:
url = Endpoint.recent_releases.format(owner_name=owner_name, app_name=app_name)
Is it possible to format this using f-strings? I have tried this:
class Endpoint:
recent_releases = f"apps/{owner_name}/{app_name}/recent_releases"
recent_latest = f"apps/{owner_name}/{app_name}/releases/{release_id}"
but I'd have create an __init__()
function in the class.