- Sort Score
- Num 10 results
- Language All
Results 121 - 130 of 1,083 for str (0.08 seconds)
-
docs_src/body_nested_models/tutorial006_py310.py
from fastapi import FastAPI from pydantic import BaseModel, HttpUrl app = FastAPI() class Image(BaseModel): url: HttpUrl name: str class Item(BaseModel): name: str description: str | None = None price: float tax: float | None = None tags: set[str] = set() images: list[Image] | None = None @app.put("/items/{item_id}") async def update_item(item_id: int, item: Item):
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Fri Jan 07 14:11:31 GMT 2022 - 475 bytes - Click Count (0) -
docs/zh-hant/docs/python-types.md
/// info | 資訊 方括號裡的那些內部型別稱為「型別參數」。 在這個例子中,`str` 是傳給 `list` 的型別參數。 /// 這表示:「變數 `items` 是一個 `list`,而這個清單中的每個元素都是 `str`」。 這麼做之後,你的編輯器甚至在處理清單裡的項目時也能提供支援: <img src="/img/python-types/image05.png"> 沒有型別時,幾乎不可能做到這點。 請注意,變數 `item` 是清單 `items` 中的一個元素。 即便如此,編輯器仍然知道它是 `str`,並提供相應的支援。 #### Tuple 與 Set { #tuple-and-set } 你也可以用相同方式來宣告 `tuple` 與 `set`:
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Fri Mar 20 17:05:38 GMT 2026 - 10.7K bytes - Click Count (0) -
docs_src/body_multiple_params/tutorial003_an_py310.py
from fastapi import Body, FastAPI from pydantic import BaseModel app = FastAPI() class Item(BaseModel): name: str description: str | None = None price: float tax: float | None = None class User(BaseModel): username: str full_name: str | None = None @app.put("/items/{item_id}") async def update_item(
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Sat Mar 18 12:29:59 GMT 2023 - 550 bytes - Click Count (0) -
docs_src/settings/tutorial001_py310.py
from fastapi import FastAPI from pydantic_settings import BaseSettings class Settings(BaseSettings): app_name: str = "Awesome API" admin_email: str items_per_user: int = 50 settings = Settings() app = FastAPI() @app.get("/info") async def info(): return { "app_name": settings.app_name, "admin_email": settings.admin_email, "items_per_user": settings.items_per_user,
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Thu Feb 12 13:19:43 GMT 2026 - 419 bytes - Click Count (0) -
docs_src/background_tasks/tutorial002_an_py310.py
from typing import Annotated from fastapi import BackgroundTasks, Depends, FastAPI app = FastAPI() def write_log(message: str): with open("log.txt", mode="a") as log: log.write(message) def get_query(background_tasks: BackgroundTasks, q: str | None = None): if q: message = f"found query: {q}\n" background_tasks.add_task(write_log, message) return q
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Sat Mar 18 12:29:59 GMT 2023 - 683 bytes - Click Count (0) -
src/main/java/org/codelibs/core/text/Tokenizer.java
*/ public Tokenizer(final String str, final byte[] ctype) { assertArgumentNotNull("str", str); assertArgumentNotEmpty("ctype", ctype); this.str = str; this.ctype = ctype; } /** * Sets up the character type array. * * @param ctype2 * The array of character types to set up. */Created: Fri Apr 03 20:58:12 GMT 2026 - Last Modified: Sat Jul 05 00:11:05 GMT 2025 - 8.8K bytes - Click Count (0) -
docs_src/app_testing/app_b_an_py310/main.py
"bar": {"id": "bar", "title": "Bar", "description": "The bartenders"}, } app = FastAPI() class Item(BaseModel): id: str title: str description: str | None = None @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")
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) -
docs_src/response_model/tutorial005_py310.py
from fastapi import FastAPI from pydantic import BaseModel app = FastAPI() class Item(BaseModel): name: str description: str | None = None price: float tax: float = 10.5 items = { "foo": {"name": "Foo", "price": 50.2}, "bar": {"name": "Bar", "description": "The Bar fighters", "price": 62, "tax": 20.2}, "baz": { "name": "Baz", "description": "There goes my baz",
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Fri Jan 07 14:11:31 GMT 2022 - 816 bytes - Click Count (0) -
internal/store/store_test.go
} } } func TestParseKey(t *testing.T) { testCases := []struct { str string expectedKey Key }{ { str: "01894394-d046-4783-ba0d-f1c6885790dc.event", expectedKey: Key{ Name: "01894394-d046-4783-ba0d-f1c6885790dc", Extension: ".event", ItemCount: 1, }, }, { str: "100:01894394-d046-4783-ba0d-f1c6885790dc.event.snappy", expectedKey: Key{
Created: Sun Apr 05 19:28:12 GMT 2026 - Last Modified: Fri Sep 06 23:06:30 GMT 2024 - 4K bytes - Click Count (0) -
android/guava/src/com/google/common/io/AppendableWriter.java
} @Override public void write(String str) throws IOException { checkNotNull(str); checkNotClosed(); target.append(str); } @Override public void write(String str, int off, int len) throws IOException { checkNotNull(str); checkNotClosed(); // tricky: append takes start, end pair... target.append(str, off, off + len); } @Override
Created: Fri Apr 03 12:43:13 GMT 2026 - Last Modified: Thu Aug 07 16:37:28 GMT 2025 - 3.4K bytes - Click Count (0)