Type Hints Are Not Enforced
This function loads a retry count from a config dict:
def get_retry_count(config: dict[str, int]) -> int:
return config.get("retries", 3)
value = get_retry_count({"retries": "5"})
print(value, type(value))
print(value + 1)
The config was built from parsed JSON, so "retries" holds the string "5", not the int 5. What happens when this runs?
Sign in to answer questions and track your progress
Sign In