Maybe this will help: >>> def get(key, default): ... print("entering get") ... print(f"{key=} {default=}") ... print("exiting get") ... >>> def generate_default(): ... print("entering generate_default") ... print("exiting generate_default") ... return 1 ... >>> get("a", generate_default()) entering generate_default exiting generate_default entering get key='a' default=1 exiting get >>>
-- https://mail.python.org/mailman/listinfo/python-list