- Sort Score
- Num 10 results
- Language All
Results 241 - 250 of 500 for defa (0.02 seconds)
-
docs/tr/docs/tutorial/dependencies/index.md
`async def` ya da normal `def` kullanabilirsiniz. Ayrıca normal `def` *path operation function*'ları içinde `async def` dependency tanımlayabilir veya `async def` *path operation function*'ları içinde `def` dependency kullanabilirsiniz vb. Fark etmez. **FastAPI** ne yapacağını bilir. /// note | Not
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Fri Mar 20 07:53:17 GMT 2026 - 10.2K bytes - Click Count (0) -
docs_src/dataclasses_/tutorial003_py310.py
app = FastAPI() @app.post("/authors/{author_id}/items/", response_model=Author) # (4) async def create_author_items(author_id: str, items: list[Item]): # (5) return {"name": author_id, "items": items} # (6) @app.get("/authors/", response_model=list[Author]) # (7) def get_authors(): # (8) return [ # (9) { "name": "Breaters", "items": [ {
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Fri Dec 26 10:43:02 GMT 2025 - 1.3K bytes - Click Count (0) -
tests/test_pydanticv2_dataclasses_uuid_stringified_annotations.py
app = FastAPI() @app.get("/item", response_model=Item) async def read_item(): return { "id": uuid.uuid4(), "name": "Island In The Moon", "price": 12.99, "description": "A place to be playin' and havin' fun", "tags": ["breater"], } client = TestClient(app) def test_annotations(): response = client.get("/item")
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Mon Mar 16 10:16:48 GMT 2026 - 1.1K bytes - Click Count (0) -
docs/zh-hant/docs/advanced/advanced-python-types.md
```python from typing import Optional def say_hi(name: Optional[str]): print(f"Hey {name}!") ``` 參數 `name` 被標註為 `Optional[str]`,但它並不是可選的;你不能在沒有該參數的情況下呼叫這個函式: ```Python say_hi() # 糟了,這會拋出錯誤!😱 ``` 參數 `name` 仍是必填(不是可選),因為它沒有預設值。不過,`name` 可以接受 `None` 作為值: ```Python say_hi(name=None) # 這可行,None 是有效的 🎉 ``` 好消息是,多數情況下你可以直接用 `|` 來定義型別聯集: ```python def say_hi(name: str | None):
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Sat Feb 14 08:15:26 GMT 2026 - 1.9K bytes - Click Count (0) -
docs_src/app_testing/app_b_an_py310/main.py
@app.get("/items/{item_id}", response_model=Item) async def read_main(item_id: str, x_token: Annotated[str, Header()]): if x_token != fake_secret_token: raise HTTPException(status_code=400, detail="Invalid X-Token header") if item_id not in fake_db: raise HTTPException(status_code=404, detail="Item not found") return fake_db[item_id] @app.post("/items/")
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Wed Feb 04 13:32:24 GMT 2026 - 1.1K bytes - Click Count (0) -
src/main/resources/fess_indices/fess/pt-br/stopwords.txt
a ainda alem ambas ambos antes ao aonde aos apos aquele aqueles as assim com como contra contudo cuja cujas cujo cujos da das de dela dele deles demais depois desde desta deste dispoe dispoem diversa diversas diversos do dos durante e ela elas ele eles em entao entre essa essas
Created: Tue Mar 31 13:07:34 GMT 2026 - Last Modified: Thu Jul 19 06:31:02 GMT 2018 - 820 bytes - Click Count (0) -
docs/ru/docs/index.md
app = FastAPI() @app.get("/") def read_root(): return {"Hello": "World"} @app.get("/items/{item_id}") def read_item(item_id: int, q: str | None = None): return {"item_id": item_id, "q": q} ``` <details markdown="1"> <summary>Или используйте <code>async def</code>...</summary> Если ваш код использует `async` / `await`, используйте `async def`: ```Python hl_lines="7 12"
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Thu Mar 19 17:56:20 GMT 2026 - 30.4K bytes - Click Count (0) -
docs/zh-hant/docs/advanced/dataclasses.md
FastAPI 仍能將資料<dfn title="將資料轉換成可傳輸的格式">序列化</dfn>為 JSON。 7. 這裡 `response_model` 使用的是「`Author` dataclass 的清單」這種型別註記。 同樣地,你可以把 `dataclasses` 與標準型別註記組合使用。 8. 注意這個「路徑操作函式」使用的是一般的 `def` 而非 `async def`。 一如往常,在 FastAPI 中你可以視需要混用 `def` 與 `async def`。 如果需要複習何時用哪個,請參考文件中關於 [`async` 與 `await`](../async.md#in-a-hurry) 的章節「In a hurry?」。 9. 這個「路徑操作函式」回傳的不是 dataclass(雖然也可以),而是一個包含內部資料的字典清單。
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Fri Mar 20 17:05:38 GMT 2026 - 3.8K bytes - Click Count (0) -
build-tools-internal/src/integTest/groovy/org/elasticsearch/gradle/internal/ElasticsearchTestBasePluginFuncTest.groovy
import org.elasticsearch.gradle.fixtures.AbstractGradleFuncTest import org.gradle.testkit.runner.TaskOutcome class ElasticsearchTestBasePluginFuncTest extends AbstractGradleFuncTest { def "can configure nonInputProperties for test tasks"() { given: file("src/test/java/acme/SomeTests.java").text = """ public class SomeTests { @org.junit.TestCreated: Wed Apr 08 16:19:15 GMT 2026 - Last Modified: Tue Jun 01 09:19:30 GMT 2021 - 1.7K bytes - Click Count (0) -
docs/de/docs/tutorial/dependencies/index.md
Sie können `async def` oder einfach `def` verwenden. Und Sie können Abhängigkeiten mit `async def` innerhalb normaler `def`-*Pfadoperation-Funktionen* oder `def`-Abhängigkeiten innerhalb von `async def`-*Pfadoperation-Funktionen*, usw. deklarieren. Es spielt keine Rolle. **FastAPI** weiß, was zu tun ist. /// note | Hinweis
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Thu Mar 19 17:58:09 GMT 2026 - 11.3K bytes - Click Count (0)