Search Options

Display Count
Sort
Preferred Language
Advanced Search

Results 101 - 110 of 1,091 for Fstr (0.02 seconds)

  1. scripts/topic_repos.py

    from pydantic import BaseModel, SecretStr
    from pydantic_settings import BaseSettings
    
    
    class Settings(BaseSettings):
        github_repository: str
        github_token: SecretStr
    
    
    class Repo(BaseModel):
        name: str
        html_url: str
        stars: int
        owner_login: str
        owner_html_url: str
    
    
    def main() -> None:
        logging.basicConfig(level=logging.INFO)
        settings = Settings()
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Tue Dec 16 12:34:01 GMT 2025
    - 2.7K bytes
    - Click Count (0)
  2. 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)
  3. docs_src/response_model/tutorial003_py310.py

    from fastapi import FastAPI
    from pydantic import BaseModel, EmailStr
    
    app = FastAPI()
    
    
    class UserIn(BaseModel):
        username: str
        password: str
        email: EmailStr
        full_name: str | None = None
    
    
    class UserOut(BaseModel):
        username: str
        email: EmailStr
        full_name: str | None = None
    
    
    @app.post("/user/", response_model=UserOut)
    async def create_user(user: UserIn) -> Any:
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Sat Jan 07 13:45:48 GMT 2023
    - 431 bytes
    - Click Count (0)
  4. tests/test_request_params/test_cookie/test_required_str.py

    
    @app.get("/required-str")
    async def read_required_str(p: Annotated[str, Cookie()]):
        return {"p": p}
    
    
    class CookieModelRequiredStr(BaseModel):
        p: str
    
    
    @app.get("/model-required-str")
    async def read_model_required_str(p: Annotated[CookieModelRequiredStr, Cookie()]):
        return {"p": p.p}
    
    
    @pytest.mark.parametrize(
        "path",
        ["/required-str", "/model-required-str"],
    )
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Sun Feb 08 10:18:38 GMT 2026
    - 10.4K bytes
    - Click Count (0)
  5. docs/zh-hant/docs/tutorial/extra-data-types.md

    * `datetime.date`:
        * Python 的 `datetime.date`。
        * 在請求與回應中會以 ISO 8601 格式的 `str` 表示,例如:`2008-09-15`。
    * `datetime.time`:
        * Python 的 `datetime.time`。
        * 在請求與回應中會以 ISO 8601 格式的 `str` 表示,例如:`14:23:55.003`。
    * `datetime.timedelta`:
        * Python 的 `datetime.timedelta`。
        * 在請求與回應中會以總秒數的 `float` 表示。
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Fri Mar 20 17:05:38 GMT 2026
    - 2.6K bytes
    - Click Count (0)
  6. docs/zh/docs/tutorial/extra-data-types.md

    * `datetime.date`:
        * Python `datetime.date`.
        * 在请求和响应中将表示为 ISO 8601 格式的 `str` ,比如: `2008-09-15`.
    * `datetime.time`:
        * 一个 Python `datetime.time`.
        * 在请求和响应中将表示为 ISO 8601 格式的 `str` ,比如:  `14:23:55.003`.
    * `datetime.timedelta`:
        * 一个 Python `datetime.timedelta`.
        * 在请求和响应中将表示为 `float` 代表总秒数。
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Fri Mar 20 17:06:37 GMT 2026
    - 2.5K bytes
    - Click Count (0)
  7. impl/maven-cli/src/main/java/org/apache/maven/cling/invoker/CliUtils.java

        public static String stripLeadingAndTrailingQuotes(String str) {
            requireNonNull(str, "str");
            final int length = str.length();
            if (length > 1
                    && str.startsWith("\"")
                    && str.endsWith("\"")
                    && str.substring(1, length - 1).indexOf('"') == -1) {
                str = str.substring(1, length - 1);
            }
            return str;
        }
    
        @Nonnull
    Created: Sun Apr 05 03:35:12 GMT 2026
    - Last Modified: Mon Oct 13 18:30:29 GMT 2025
    - 5K bytes
    - Click Count (0)
  8. tests/test_allow_inf_nan_in_enforcing.py

        b: Annotated[float, Body(allow_inf_nan=False)] = 0,
    ) -> str:
        return "OK"
    
    
    client = TestClient(app)
    
    
    @pytest.mark.parametrize(
        "value,code",
        [
            ("-1", 200),
            ("inf", 200),
            ("-inf", 200),
            ("nan", 200),
            ("0", 200),
            ("342", 200),
        ],
    )
    def test_allow_inf_nan_param_true(value: str, code: int):
        response = client.post(f"/?x={value}")
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Wed Dec 17 21:25:59 GMT 2025
    - 1.8K bytes
    - Click Count (0)
  9. tests/test_invalid_sequence_param.py

            app = FastAPI()
    
            class Item(BaseModel):
                title: str
    
            @app.get("/items/")
            def read_items(q: dict[str, Item] = Query(default=None)):
                pass  # pragma: no cover
    
    
    def test_invalid_simple_dict():
        with pytest.raises(
            AssertionError,
            match="Query parameter 'q' must be one of the supported types",
        ):
            app = FastAPI()
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Tue Feb 17 09:59:14 GMT 2026
    - 1.5K bytes
    - Click Count (0)
  10. docs/ja/docs/tutorial/metadata.md

    | パラメータ | 型 | 説明 |
    |------------|------|-------------|
    | `title` | `str` | APIのタイトルです。 |
    | `summary` | `str` | APIの短い要約です。 <small>OpenAPI 3.1.0、FastAPI 0.99.0 以降で利用できます。</small> |
    | `description` | `str` | APIの短い説明です。Markdownを使用できます。 |
    | `version` | `string` | APIのバージョンです。これはOpenAPIのバージョンではなく、あなた自身のアプリケーションのバージョンです。たとえば `2.5.0` です。 |
    | `terms_of_service` | `str` | APIの利用規約へのURLです。指定する場合、URLである必要があります。 |
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Fri Mar 20 14:07:17 GMT 2026
    - 6.9K bytes
    - Click Count (0)
Back to Top