Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for Fluffy (0.98 sec)

  1. docs/de/docs/tutorial/dependencies/classes-as-dependencies.md

    Zum Beispiel:
    
    ```Python
    class Cat:
        def __init__(self, name: str):
            self.name = name
    
    
    fluffy = Cat(name="Mr Fluffy")
    ```
    
    In diesem Fall ist `fluffy` eine Instanz der Klasse `Cat`.
    
    Und um `fluffy` zu erzeugen, rufen Sie `Cat` auf.
    
    Eine Python-Klasse ist also auch ein **Callable**.
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat Mar 30 18:01:58 GMT 2024
    - 12.3K bytes
    - Viewed (0)
  2. docs/en/docs/tutorial/dependencies/classes-as-dependencies.md

    For example:
    
    ```Python
    class Cat:
        def __init__(self, name: str):
            self.name = name
    
    
    fluffy = Cat(name="Mr Fluffy")
    ```
    
    In this case, `fluffy` is an instance of the class `Cat`.
    
    And to create `fluffy`, you are "calling" `Cat`.
    
    So, a Python class is also a **callable**.
    
    Then, in **FastAPI**, you could use a Python class as a dependency.
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 11.4K bytes
    - Viewed (0)
Back to top