- Sort Score
- Num 10 results
- Language All
Results 221 - 230 of 1,705 for nonce (0.02 seconds)
-
docs/en/docs/advanced/advanced-python-types.md
```python from typing import Union def say_hi(name: Union[str, None]): print(f"Hi {name}!") ``` `typing` also has a shortcut to declare that something could be `None`, with `Optional`. Here's a tip from my very **subjective** point of view: * đ¨ Avoid using `Optional[SomeType]` * Instead ⨠**use `Union[SomeType, None]`** â¨.
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Wed Feb 11 18:32:12 GMT 2026 - 2K bytes - Click Count (0) -
docs_src/body/tutorial004_py310.py
from fastapi import FastAPI from pydantic import BaseModel class Item(BaseModel): name: str description: str | None = None price: float tax: float | None = None app = FastAPI() @app.put("/items/{item_id}") async def update_item(item_id: int, item: Item, q: str | None = None): result = {"item_id": item_id, **item.model_dump()} if q: result.update({"q": q})
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Sat Dec 20 15:55:38 GMT 2025 - 414 bytes - Click Count (0) -
.mailmap
Paul Merlin <******@****.***> <******@****.***> Peter Niederwieser <******@****.***> <pniederw@.(none)> Peter Niederwieser <******@****.***> <pniederw@pniederw-PC.(none)> Piotr Jagielski <******@****.***> <Piotr Jagielski> Rene Groeschke <******@****.***> <Rene@DevWin7.(none)> Rene Groeschke <******@****.***> <******@****.***> Rene Groeschke <******@****.***> <******@****.***>
Created: Wed Apr 01 11:36:16 GMT 2026 - Last Modified: Tue Oct 03 06:34:28 GMT 2017 - 3.3K bytes - Click Count (0) -
docs_src/body_nested_models/tutorial005_py310.py
app = FastAPI() class Image(BaseModel): url: HttpUrl name: str class Item(BaseModel): name: str description: str | None = None price: float tax: float | None = None tags: set[str] = set() image: Image | None = None @app.put("/items/{item_id}") async def update_item(item_id: int, item: Item): results = {"item_id": item_id, "item": item}
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Fri Jan 07 14:11:31 GMT 2022 - 468 bytes - Click Count (0) -
docs_src/body_multiple_params/tutorial003_py310.py
from fastapi import Body, FastAPI from pydantic import BaseModel app = FastAPI() class Item(BaseModel): name: str description: str | None = None price: float tax: float | None = None class User(BaseModel): username: str full_name: str | None = None @app.put("/items/{item_id}") async def update_item(item_id: int, item: Item, user: User, importance: int = Body()):
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Fri May 13 23:38:22 GMT 2022 - 504 bytes - Click Count (0) -
fastapi/encoders.py
return str(obj) if isinstance(obj, (str, int, float, type(None))): return obj if isinstance(obj, PydanticUndefinedType): return None if isinstance(obj, dict): encoded_dict = {} allowed_keys = set(obj.keys()) if include is not None: allowed_keys &= set(include) if exclude is not None: allowed_keys -= set(exclude)
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Sun Mar 15 11:44:39 GMT 2026 - 10.9K bytes - Click Count (0) -
docs/ja/docs/tutorial/query-params-str-validations.md
ããŽå ´åīŧ`Annotated` ãäŊŋããĒãå ´åīŧãéĸæ°å ãŽãããŠãĢãå¤ `None` ã `Query()` ãĢįŊŽãæããåŋ čĻãããããã`Query(default=None)` ãŽããŠãĄãŧãŋã§ãããŠãĢãå¤ãč¨åŽããåŋ čĻããããžããããã¯īŧå°ãĒãã¨ã FastAPI ãĢã¨ãŖãĻã¯īŧããŽãããŠãĢãå¤ãåŽįžŠãããŽã¨åãįŽįãæãããžãã ãĒãŽã§: ```Python q: str | None = Query(default=None) ``` ...ã¯ãããŠãĢãå¤ `None` ãæã¤ãĒããˇã§ããĢãĒããŠãĄãŧãŋãĢãĒããäģĨä¸ã¨åãã§ã: ```Python q: str | None = None ``` ãã ã `Query` ãŽããŧã¸ã§ãŗã§ã¯ãã¯ã¨ãĒããŠãĄãŧãŋã§ãããã¨ãæį¤ēįãĢåŽŖč¨ããĻããžãã
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Fri Mar 20 14:07:17 GMT 2026 - 20.3K bytes - Click Count (0) -
scripts/docs.py
def get_lang_paths() -> list[Path]: return sorted(docs_path.iterdir()) def lang_callback(lang: str | None) -> str | None: if lang is None: return None lang = lang.lower() return lang def complete_existing_lang(incomplete: str): lang_path: Path for lang_path in get_lang_paths():
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Thu Mar 05 17:46:10 GMT 2026 - 25.4K bytes - Click Count (0) -
tests/test_enforce_once_required_parameter.py
return f"{client_id}_key" def _get_client_tag(client_id: str | None = Query(None)) -> str | None: if client_id is None: return None return f"{client_id}_tag" @app.get("/foo") def foo_handler( client_key: str = Depends(_get_client_key), client_tag: str | None = Depends(_get_client_tag), ): return {"client_id": client_key, "client_tag": client_tag}Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Tue Feb 17 09:59:14 GMT 2026 - 4.1K bytes - Click Count (0) -
tests/test_dependency_class.py
class CallableGenDependency: def __call__(self, value: str) -> Generator[str, None, None]: yield value class AsyncCallableDependency: async def __call__(self, value: str) -> str: return value class AsyncCallableGenDependency: async def __call__(self, value: str) -> AsyncGenerator[str, None]: yield value class MethodsDependency:Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Wed Dec 17 21:25:59 GMT 2025 - 4.4K bytes - Click Count (0)