Search Options

Display Count
Sort
Preferred Language
Advanced Search

Results 171 - 180 of 1,039 for Python (0.04 seconds)

  1. docs/en/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+ non-Annotated
    
    /// tip
    
    Prefer to use the `Annotated` version if possible.
    
    ///
    
    ```Python hl_lines="1"
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Wed Feb 11 18:32:12 GMT 2026
    - 3.7K bytes
    - Click Count (0)
  2. docs/zh-hant/docs/tutorial/request-forms.md

    # 表單資料 { #form-data }
    
    當你需要接收表單欄位而不是 JSON 時,可以使用 `Form`。
    
    /// info
    
    要使用表單,請先安裝 [`python-multipart`](https://github.com/Kludex/python-multipart)。
    
    請先建立並啟用一個[虛擬環境](../virtual-environments.md),然後再安裝,例如:
    
    ```console
    $ pip install python-multipart
    ```
    
    ///
    
    ## 匯入 `Form` { #import-form }
    
    從 `fastapi` 匯入 `Form`:
    
    {* ../../docs_src/request_forms/tutorial001_an_py310.py hl[3] *}
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Fri Mar 20 17:05:38 GMT 2026
    - 2.5K bytes
    - Click Count (0)
  3. docs/zh-hant/docs/tutorial/body-nested-models.md

    ```Python
    my_list: list[str]
    ```
    
    以上都是標準的 Python 型別宣告語法。
    
    對於具有內部型別的模型屬性,也使用相同的標準語法。
    
    因此,在我們的範例中,可以讓 `tags` 明確成為「字串的列表」:
    
    {* ../../docs_src/body_nested_models/tutorial002_py310.py hl[12] *}
    
    ## 集合型別 { #set-types }
    
    但進一步思考後,我們會意識到 `tags` 不應該重覆,應該是唯一的字串。
    
    而 Python 有一種用於唯一元素集合的特殊資料型別:`set`。
    
    因此我們可以將 `tags` 宣告為字串的 `set`:
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Fri Mar 20 17:05:38 GMT 2026
    - 6.5K bytes
    - Click Count (0)
  4. docs/ko/docs/tutorial/request-forms-and-files.md

    # 폼 및 파일 요청 { #request-forms-and-files }
    
    `File` 과 `Form` 을 사용하여 파일과 폼 필드를 동시에 정의할 수 있습니다.
    
    /// info
    
    업로드된 파일 및/또는 폼 데이터를 받으려면 먼저 [`python-multipart`](https://github.com/Kludex/python-multipart)를 설치해야 합니다.
    
    [가상 환경](../virtual-environments.md)을 생성하고, 활성화한 다음 설치해야 합니다. 예:
    
    ```console
    $ pip install python-multipart
    ```
    
    ///
    
    ## `File` 및 `Form` 임포트 { #import-file-and-form }
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Fri Mar 20 14:06:26 GMT 2026
    - 1.6K bytes
    - Click Count (0)
  5. docs/en/docs/contributing.md

    ### Using your local FastAPI
    
    If you create a Python file that imports and uses FastAPI, and run it with the Python from your local environment, it will use your cloned local FastAPI source code.
    
    And if you update that local FastAPI source code when you run that Python file again, it will use the fresh version of FastAPI you just edited.
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Mon Mar 23 13:59:26 GMT 2026
    - 10.6K bytes
    - Click Count (0)
  6. docs/en/docs/async.md

    ## `async` and `await` { #async-and-await }
    
    Modern versions of Python have a very intuitive way to define asynchronous code. This makes it look just like normal "sequential" code and do the "awaiting" for you at the right moments.
    
    When there is an operation that will require waiting before giving the results and has support for these new Python features, you can code it like:
    
    ```Python
    burgers = await get_burgers(2)
    ```
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Mar 05 18:13:19 GMT 2026
    - 23.4K bytes
    - Click Count (0)
  7. fastapi/.agents/skills/fastapi/references/dependencies.md

    When using dependencies with `yield`, they can have a `scope` that defines when the exit code is run.
    
    Use the default scope `"request"` to run the exit code after the response is sent back.
    
    ```python
    from typing import Annotated
    
    from fastapi import Depends, FastAPI
    
    app = FastAPI()
    
    
    def get_db():
        db = DBSession()
        try:
            yield db
        finally:
            db.close()
    
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Sun Mar 01 10:05:57 GMT 2026
    - 3.2K bytes
    - Click Count (0)
  8. docs/zh-hant/docs/tutorial/encoder.md

    {* ../../docs_src/encoder/tutorial001_py310.py hl[4,21] *}
    
    在此範例中,它會把 Pydantic 模型轉成 `dict`,並將 `datetime` 轉成 `str`。
    
    呼叫後的結果可以用 Python 標準的 [`json.dumps()`](https://docs.python.org/3/library/json.html#json.dumps) 進行編碼。
    
    它不會回傳一個包含 JSON 內容的大型 `str`(字串)。它會回傳 Python 標準的資料結構(例如 `dict`),其中的值與子值都與 JSON 相容。
    
    /// note
    
    事實上,`jsonable_encoder` 在 **FastAPI** 內部也被用來轉換資料。不過在許多其他情境中它同樣實用。
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Fri Mar 20 17:05:38 GMT 2026
    - 1.5K bytes
    - Click Count (0)
  9. docs/ja/docs/tutorial/header-params.md

    ほとんどの標準ヘッダーは、「マイナス記号」(`-`)としても知られる「ハイフン」文字で区切られています。
    
    しかし、`user-agent`のような変数はPythonでは無効です。
    
    そのため、デフォルトでは、`Header`はパラメータ名の文字をアンダースコア(`_`)からハイフン(`-`)に変換して、ヘッダーを抽出して文書化します。
    
    また、HTTPヘッダは大文字小文字を区別しないので、Pythonの標準スタイル(別名「スネークケース」)で宣言することができます。
    
    そのため、`User_Agent`などのように最初の文字を大文字にする必要はなく、通常のPythonコードと同じように`user_agent`を使用することができます。
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Wed Feb 04 16:44:21 GMT 2026
    - 3.9K bytes
    - Click Count (0)
  10. tensorflow/BUILD

    load(
        "//tensorflow/python/tools/api/generator:api_gen.bzl",
        "get_compat_files",
        "get_nested_compat_files",
    )
    load(
        "//tensorflow/python/tools/api/generator:api_init_files.bzl",
        "TENSORFLOW_API_INIT_FILES",
    )
    load(
        "//tensorflow/python/tools/api/generator:api_init_files_v1.bzl",
        "TENSORFLOW_API_INIT_FILES_V1",
    )
    Created: Tue Apr 07 12:39:13 GMT 2026
    - Last Modified: Tue Mar 24 21:00:18 GMT 2026
    - 53.1K bytes
    - Click Count (0)
Back to Top