Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 30 for generic (0.2 sec)

  1. tests/test_generic_parameterless_depends.py

    @app.get("/a")
    async def a(dep: Dep[A]):
        return {"cls": dep.__class__.__name__}
    
    
    @app.get("/b")
    async def b(dep: Dep[B]):
        return {"cls": dep.__class__.__name__}
    
    
    client = TestClient(app)
    
    
    def test_generic_parameterless_depends():
        response = client.get("/a")
        assert response.status_code == 200, response.text
        assert response.json() == {"cls": "A"}
    
        response = client.get("/b")
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Tue Apr 02 02:52:56 GMT 2024
    - 1.8K bytes
    - Viewed (0)
  2. docs/uk/docs/python-types.md

        ```
    
    === "Python 3.10 і вище"
    
        ```Python hl_lines="1"
        {!> ../../../docs_src/python_types/tutorial009_py310.py!}
        ```
    
    #### Generic типи
    
    Ці типи, які приймають параметри типу у квадратних дужках, називаються **Generic types** or **Generics**, наприклад:
    
    === "Python 3.8 і вище"
    
        * `List`
        * `Tuple`
        * `Set`
        * `Dict`
        * `Union`
        * `Optional`
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 19.7K bytes
    - Viewed (0)
  3. docs/ru/docs/python-types.md

    #### Generic-типы
    
    Эти типы принимают параметры в квадратных скобках:
    
    * `List`
    * `Tuple`
    * `Set`
    * `Dict`
    * `Optional`
    * ...и др.
    
    называются **Generic-типами** или **Generics**.
    
    ### Классы как типы
    
    Вы также можете объявить класс как тип переменной.
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Mar 22 01:42:11 GMT 2024
    - 14.6K bytes
    - Viewed (0)
  4. docs/en/docs/python-types.md

    ```
    
    And then you won't have to worry about names like `Optional` and `Union`. 😎
    
    #### Generic types
    
    These types that take type parameters in square brackets are called **Generic types** or **Generics**, for example:
    
    === "Python 3.10+"
    
        You can use the same builtin types as generics (with square brackets and types inside):
    
        * `list`
        * `tuple`
        * `set`
        * `dict`
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 17K bytes
    - Viewed (0)
  5. docs/es/docs/benchmarks.md

        * Si no usaras FastAPI y usaras Starlette directamente (u otra herramienta, como Sanic, Flask, Responder, etc.), tendrías que implementar toda la validación y serialización de datos tu mismo. Por lo tanto, tu aplicación final...
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Wed Feb 07 11:39:50 GMT 2024
    - 3.9K bytes
    - Viewed (0)
  6. docs/en/docs/advanced/middleware.md

    A middleware doesn't have to be made for FastAPI or Starlette to work, as long as it follows the ASGI spec.
    
    In general, ASGI middlewares are classes that expect to receive an ASGI app as the first argument.
    
    So, in the documentation for third-party ASGI middlewares they will probably tell you to do something like:
    
    ```Python
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Mar 10 18:27:10 GMT 2023
    - 4K bytes
    - Viewed (0)
  7. docs/en/docs/tutorial/path-params.md

    ```Python hl_lines="17"
    {!../../../docs_src/path_params/tutorial005.py!}
    ```
    
    #### Get the *enumeration value*
    
    You can get the actual value (a `str` in this case) using `model_name.value`, or in general, `your_enum_member.value`:
    
    ```Python hl_lines="20"
    {!../../../docs_src/path_params/tutorial005.py!}
    ```
    
    !!! tip
        You could also access the value `"lenet"` with `ModelName.lenet.value`.
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Mar 22 01:42:11 GMT 2024
    - 9.1K bytes
    - Viewed (0)
  8. docs/en/docs/deployment/manually.md

    The word "**server**" is commonly used to refer to both the remote/cloud computer (the physical or virtual machine) and also the program that is running on that machine (e.g. Uvicorn).
    
    Just keep in mind that when you read "server" in general, it could refer to one of those two things.
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu May 02 22:37:31 GMT 2024
    - 9.2K bytes
    - Viewed (0)
  9. docs/en/docs/advanced/generate-clients.md

    We will probably still want to keep it for OpenAPI in general, as that will ensure that the operation IDs are **unique**.
    
    But for the generated client we could **modify** the OpenAPI operation IDs right before generating the clients, just to make those method names nicer and **cleaner**.
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 10.5K bytes
    - Viewed (0)
  10. docs/en/docs/how-to/general.md

    # General - How To - Recipes
    
    Here are several pointers to other places in the docs, for general or frequent questions.
    
    ## Filter Data - Security
    
    To ensure that you don't return more data than you should, read the docs for [Tutorial - Response Model - Return Type](../tutorial/response-model.md){.internal-link target=_blank}.
    
    ## Documentation Tags - OpenAPI
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat Aug 19 19:54:04 GMT 2023
    - 2.3K bytes
    - Viewed (0)
Back to top