_default() — flask Function Reference
Architecture documentation for the _default() function in provider.py from the flask codebase.
Entity Profile
Dependency Diagram
graph TD 495a78d7_26f1_1764_0f3e_4b0560d2f70d["_default()"] 64bf3a3f_ca45_015e_bd00_0190cbad6928["provider.py"] 495a78d7_26f1_1764_0f3e_4b0560d2f70d -->|defined in| 64bf3a3f_ca45_015e_bd00_0190cbad6928 style 495a78d7_26f1_1764_0f3e_4b0560d2f70d fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
src/flask/json/provider.py lines 108–121
def _default(o: t.Any) -> t.Any:
if isinstance(o, date):
return http_date(o)
if isinstance(o, (decimal.Decimal, uuid.UUID)):
return str(o)
if dataclasses and dataclasses.is_dataclass(o):
return dataclasses.asdict(o) # type: ignore[arg-type]
if hasattr(o, "__html__"):
return str(o.__html__())
raise TypeError(f"Object of type {type(o).__name__} is not JSON serializable")
Domain
Subdomains
Defined In
Source
Frequently Asked Questions
What does _default() do?
_default() is a function in the flask codebase, defined in src/flask/json/provider.py.
Where is _default() defined?
_default() is defined in src/flask/json/provider.py at line 108.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free