📝 Update source examples and docs from Python 3.9 to 3.10 (#14900)

This commit is contained in:
Sebastián Ramírez
2026-02-12 05:19:43 -08:00
committed by GitHub
parent d06ab3f5c7
commit c9e2277d8b
655 changed files with 3703 additions and 5660 deletions

View File

@@ -1,23 +0,0 @@
from datetime import datetime
from typing import Union
from fastapi import FastAPI
from fastapi.encoders import jsonable_encoder
from pydantic import BaseModel
fake_db = {}
class Item(BaseModel):
title: str
timestamp: datetime
description: Union[str, None] = None
app = FastAPI()
@app.put("/items/{id}")
def update_item(id: str, item: Item):
json_compatible_item_data = jsonable_encoder(item)
fake_db[id] = json_compatible_item_data