Search Options

Results per page
Sort
Preferred Languages
Advance

Results 601 - 610 of 1,127 for def2 (0.03 sec)

  1. docs_src/python_types/tutorial004.py

    def get_name_with_age(name: str, age: int):
        name_with_age = name + " is this old: " + str(age)
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Thu Mar 26 19:09:53 UTC 2020
    - 124 bytes
    - Viewed (0)
  2. docs_src/python_types/tutorial002.py

    def get_full_name(first_name: str, last_name: str):
        full_name = first_name.title() + " " + last_name.title()
        return full_name
    
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Thu Mar 26 19:09:53 UTC 2020
    - 172 bytes
    - Viewed (0)
  3. docs_src/python_types/tutorial013.py

    from typing_extensions import Annotated
    
    
    def say_hello(name: Annotated[str, "this is just metadata"]) -> str:
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sat Mar 18 12:29:59 UTC 2023
    - 138 bytes
    - Viewed (0)
  4. docs_src/python_types/tutorial013_py39.py

    from typing import Annotated
    
    
    def say_hello(name: Annotated[str, "this is just metadata"]) -> str:
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sat Mar 18 12:29:59 UTC 2023
    - 127 bytes
    - Viewed (0)
  5. docs/de/docs/index.md

    app = FastAPI()
    
    
    @app.get("/")
    def read_root():
        return {"Hello": "World"}
    
    
    @app.get("/items/{item_id}")
    def read_item(item_id: int, q: Union[str, None] = None):
        return {"item_id": item_id, "q": q}
    ```
    
    <details markdown="1">
    <summary>Oder verwenden Sie <code>async def</code> ...</summary>
    
    Wenn Ihr Code `async` / `await` verwendet, benutzen Sie `async def`:
    
    ```Python hl_lines="9  14"
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 20 19:20:23 UTC 2024
    - 21.1K bytes
    - Viewed (0)
  6. docs/it/docs/index.md

    app = FastAPI()
    
    
    @app.get("/")
    def read_root():
        return {"Hello": "World"}
    
    
    @app.get("/items/{item_id}")
    def read_item(item_id: int, q: str = Optional[None]):
        return {"item_id": item_id, "q": q}
    ```
    
    <details markdown="1">
    <summary>Oppure usa <code>async def</code>...</summary>
    
    Se il tuo codice usa `async` / `await`, allora usa `async def`:
    
    ```Python hl_lines="7  12"
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 20 19:20:23 UTC 2024
    - 19.2K bytes
    - Viewed (0)
  7. docs_src/response_status_code/tutorial002.py

    from fastapi import FastAPI, status
    
    app = FastAPI()
    
    
    @app.post("/items/", status_code=status.HTTP_201_CREATED)
    async def create_item(name: str):
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Thu Mar 26 19:09:53 UTC 2020
    - 173 bytes
    - Viewed (0)
  8. tests/test_modules_same_name_body/app/a.py

    from fastapi import APIRouter, Body
    
    router = APIRouter()
    
    
    @router.post("/compute")
    def compute(a: int = Body(), b: str = Body()):
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri May 13 23:38:22 UTC 2022
    - 160 bytes
    - Viewed (0)
  9. docs_src/body_nested_models/tutorial009.py

    from typing import Dict
    
    from fastapi import FastAPI
    
    app = FastAPI()
    
    
    @app.post("/index-weights/")
    async def create_index_weights(weights: Dict[int, float]):
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Thu Mar 26 19:09:53 UTC 2020
    - 179 bytes
    - Viewed (0)
  10. docs_src/custom_response/tutorial006.py

    from fastapi import FastAPI
    from fastapi.responses import RedirectResponse
    
    app = FastAPI()
    
    
    @app.get("/typer")
    async def redirect_typer():
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sat Jul 03 19:51:28 UTC 2021
    - 199 bytes
    - Viewed (0)
Back to top