Skip to content

Instantly share code, notes, and snippets.

import functools
import time
# --- 1. The Decorator ---
def retry_api_call():
"""Decorator that introspects 'self' for config, allowing kwargs overrides."""
def decorator(func):
@functools.wraps(func)
"""
Demonstration of field validator order dependency in Pydantic.
This script shows that field validators with mode='after' process fields
in definition order, meaning info.data only contains previously validated fields.
"""
from typing import Any
import pydantic