Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 5 of 5 for __call__ (0.23 sec)

  1. docs/zh/docs/advanced/advanced-dependencies.md

    假设要创建校验查询参数 `q` 是否包含固定内容的依赖项。
    
    但此处要把待检验的固定内容定义为参数。
    
    ## **可调用**实例
    
    Python 可以把类实例变为**可调用项**。
    
    这里说的不是类本身(类本就是可调用项),而是类实例。
    
    为此,需要声明 `__call__` 方法:
    
    ```Python hl_lines="10"
    {!../../../docs_src/dependencies/tutorial011.py!}
    ```
    
    本例中,**FastAPI**  使用 `__call__` 检查附加参数及子依赖项,稍后,还要调用它向*路径操作函数*传递值。
    
    ## 参数化实例
    
    接下来,使用 `__init__` 声明用于**参数化**依赖项的实例参数:
    
    ```Python hl_lines="7"
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sun Jan 28 18:26:57 GMT 2024
    - 2K bytes
    - Viewed (0)
  2. docs/em/docs/advanced/advanced-dependencies.md

    ✋️ 👥 💚 💪 🔗 👈 🔧 🎚.
    
    ##  "🇧🇲" 👐
    
    🐍 📤 🌌 ⚒ 👐 🎓 "🇧🇲".
    
    🚫 🎓 ⚫️ (❔ ⏪ 🇧🇲), ✋️ 👐 👈 🎓.
    
    👈, 👥 📣 👩‍🔬 `__call__`:
    
    ```Python hl_lines="10"
    {!../../../docs_src/dependencies/tutorial011.py!}
    ```
    
    👉 💼, 👉 `__call__` ⚫️❔ **FastAPI** 🔜 ⚙️ ✅ 🌖 🔢 & 🎧-🔗, & 👉 ⚫️❔ 🔜 🤙 🚶‍♀️ 💲 🔢 👆 *➡ 🛠️ 🔢* ⏪.
    
    ## 🔗 👐
    
    & 🔜, 👥 💪 ⚙️ `__init__` 📣 🔢 👐 👈 👥 💪 ⚙️ "🔗" 🔗:
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Apr 01 09:26:04 GMT 2023
    - 2K bytes
    - Viewed (0)
  3. docs/de/docs/advanced/advanced-dependencies.md

    In Python gibt es eine Möglichkeit, eine Instanz einer Klasse „aufrufbar“ („callable“) zu machen.
    
    Nicht die Klasse selbst (die bereits aufrufbar ist), sondern eine Instanz dieser Klasse.
    
    Dazu deklarieren wir eine Methode `__call__`:
    
    === "Python 3.9+"
    
        ```Python hl_lines="12"
        {!> ../../../docs_src/dependencies/tutorial011_an_py39.py!}
        ```
    
    === "Python 3.8+"
    
        ```Python hl_lines="11"
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Mar 30 20:18:49 GMT 2024
    - 4.3K bytes
    - Viewed (0)
  4. docs/en/docs/advanced/advanced-dependencies.md

    ## A "callable" instance
    
    In Python there's a way to make an instance of a class a "callable".
    
    Not the class itself (which is already a callable), but an instance of that class.
    
    To do that, we declare a method `__call__`:
    
    === "Python 3.9+"
    
        ```Python hl_lines="12"
        {!> ../../../docs_src/dependencies/tutorial011_an_py39.py!}
        ```
    
    === "Python 3.8+"
    
        ```Python hl_lines="11"
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Tue Oct 17 05:59:11 GMT 2023
    - 3.9K bytes
    - Viewed (0)
  5. RELEASE.md

        Note that this feature is only available with Python 3.7 or higher.
    
        *   Improve the informativeness of error messages raised by Keras
            `Layer.__call__()`, by adding the full list of argument values passed to
            the layer in every exception.
    
    *   Introduce the `tf.compat.v1.keras.utils.track_tf1_style_variables`
    Plain Text
    - Registered: Tue Apr 23 12:39:09 GMT 2024
    - Last Modified: Wed Apr 03 20:27:38 GMT 2024
    - 727.4K bytes
    - Viewed (8)
Back to top