- Sort Score
- Num 10 results
- Language All
Results 931 - 940 of 1,102 for DEF (0.02 seconds)
-
docs/fr/docs/advanced/events.md
Vous pouvez définir des gestionnaires d'événements (fonctions) qui doivent être exécutés avant le démarrage de l'application, ou lorsque l'application s'arrête. Ces fonctions peuvent être déclarées avec `async def` ou un `def` normal. ### Événement `startup` { #startup-event } Pour ajouter une fonction qui doit être exécutée avant le démarrage de l'application, déclarez-la avec l'événement « startup » :Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Thu Mar 19 18:37:13 GMT 2026 - 9.1K bytes - Click Count (0) -
docs/zh-hant/docs/advanced/events.md
你大概可以直接跳過這一節。 /// 也有另一種方式可以定義在 *startup* 與 *shutdown* 期間要執行的邏輯。 你可以定義事件處理器(函式)來在應用啟動前或關閉時執行。 這些函式可以用 `async def` 或一般的 `def` 宣告。 ### `startup` 事件 { #startup-event } 要加入一個在應用啟動前執行的函式,使用事件 `"startup"` 來宣告: {* ../../docs_src/events/tutorial001_py310.py hl[8] *} 在這個例子中,`startup` 事件處理器函式會用一些值來初始化 items 的「資料庫」(其實就是個 `dict`)。Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Fri Mar 20 17:05:38 GMT 2026 - 7.2K bytes - Click Count (0) -
docs/de/docs/tutorial/background-tasks.md
Es kann sich um eine `async def`- oder normale `def`-Funktion handeln. **FastAPI** weiß, wie damit zu verfahren ist. In diesem Fall schreibt die Taskfunktion in eine Datei (den Versand einer E-Mail simulierend). Und da der Schreibvorgang nicht `async` und `await` verwendet, definieren wir die Funktion mit normalem `def`: {* ../../docs_src/background_tasks/tutorial001_py310.py hl[6:9] *}
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Thu Mar 19 17:58:09 GMT 2026 - 5.7K bytes - Click Count (0) -
docs/es/docs/advanced/stream-data.md
Pero en muchos casos leer un archivo u objeto tipo archivo sí bloquearía. /// Para evitar bloquear el event loop, puedes simplemente declarar la *path operation function* con un `def` normal en lugar de `async def`; de esa forma FastAPI la ejecutará en un worker de threadpool para evitar bloquear el loop principal. {* ../../docs_src/stream_data/tutorial002_py310.py ln[30:34] hl[31] *} /// tip | ConsejoCreated: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Thu Mar 19 18:12:26 GMT 2026 - 5.7K bytes - Click Count (0) -
docs_src/python_types/tutorial008b_py310.py
def process_item(item: int | str):
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Fri Jan 07 14:11:31 GMT 2022 - 51 bytes - Click Count (0) -
docs/fr/docs/tutorial/dependencies/index.md
Vous pouvez utiliser `async def` ou un `def` normal. Et vous pouvez déclarer des dépendances avec `async def` à l’intérieur de fonctions de chemins d’accès `def` normales, ou des dépendances `def` à l’intérieur de fonctions de chemins d’accès `async def`, etc. Peu importe. **FastAPI** saura quoi faire. /// note | Remarque
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Thu Mar 19 18:37:13 GMT 2026 - 11.1K bytes - Click Count (0) -
docs/es/docs/tutorial/dependencies/sub-dependencies.md
//// tab | Python 3.10+ ```Python hl_lines="1" async def needy_dependency(fresh_value: Annotated[str, Depends(get_value, use_cache=False)]): return {"fresh_value": fresh_value} ``` //// //// tab | Python 3.10+ sin Anotaciones /// tip | Consejo Prefiere usar la versión `Annotated` si es posible. /// ```Python hl_lines="1" async def needy_dependency(fresh_value: str = Depends(get_value, use_cache=False)):
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Fri Feb 13 13:41:41 GMT 2026 - 3.9K bytes - Click Count (0) -
docs_src/path_operation_advanced_configuration/tutorial005_py310.py
from fastapi import FastAPI app = FastAPI() @app.get("/items/", openapi_extra={"x-aperture-labs-portal": "blue"}) async def read_items():
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Thu Feb 12 13:19:43 GMT 2026 - 180 bytes - Click Count (0) -
docs/ko/docs/advanced/dataclasses.md
7. 여기서 `response_model`은 `Author` dataclasses 리스트에 대한 타입 애너테이션을 사용합니다. 다시 말해, `dataclasses`를 표준 타입 애너테이션과 조합할 수 있습니다. 8. 이 *경로 처리 함수*는 `async def` 대신 일반 `def`를 사용하고 있다는 점에 주목하세요. 언제나처럼 FastAPI에서는 필요에 따라 `def`와 `async def`를 조합해 사용할 수 있습니다. 어떤 것을 언제 사용해야 하는지 다시 확인하고 싶다면, [`async`와 `await`](../async.md#in-a-hurry) 문서의 _"급하신가요?"_ 섹션을 확인하세요.Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Fri Mar 20 14:06:26 GMT 2026 - 4.8K bytes - Click Count (0) -
docs_src/query_params_str_validations/tutorial011_py310.py
from fastapi import FastAPI, Query app = FastAPI() @app.get("/items/") async def read_items(q: list[str] | None = Query(default=None)): query_items = {"q": q}
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Fri May 13 23:38:22 GMT 2022 - 189 bytes - Click Count (0)