- Sort Score
- Num 10 results
- Language All
Results 161 - 170 of 1,087 for tstr (0.02 seconds)
-
docs_src/dataclasses_/tutorial003_py39.py
@dataclass class Item: name: str description: Union[str, None] = None @dataclass class Author: name: str items: list[Item] = field(default_factory=list) # (3) app = FastAPI() @app.post("/authors/{author_id}/items/", response_model=Author) # (4) async def create_author_items(author_id: str, items: list[Item]): # (5)Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Fri Dec 26 10:43:02 GMT 2025 - 1.4K bytes - Click Count (0) -
tests/test_request_params/test_query/test_optional_str.py
@pytest.mark.parametrize( "path", ["/optional-str", "/model-optional-str"], ) def test_optional_str_missing(path: str): client = TestClient(app) response = client.get(path) assert response.status_code == 200 assert response.json() == {"p": None} @pytest.mark.parametrize( "path", ["/optional-str", "/model-optional-str"], ) def test_optional_str(path: str): client = TestClient(app)
Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Sat Dec 27 18:19:10 GMT 2025 - 8.1K bytes - Click Count (0) -
scripts/topic_repos.py
from pydantic import BaseModel, SecretStr from pydantic_settings import BaseSettings class Settings(BaseSettings): github_repository: str github_token: SecretStr class Repo(BaseModel): name: str html_url: str stars: int owner_login: str owner_html_url: str def main() -> None: logging.basicConfig(level=logging.INFO) settings = Settings()
Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Tue Dec 16 12:34:01 GMT 2025 - 2.7K bytes - Click Count (0) -
docs_src/body_nested_models/tutorial006_py39.py
from pydantic import BaseModel, HttpUrl app = FastAPI() class Image(BaseModel): url: HttpUrl name: str class Item(BaseModel): name: str description: Union[str, None] = None price: float tax: Union[float, None] = None tags: set[str] = set() images: Union[list[Image], None] = None @app.put("/items/{item_id}") async def update_item(item_id: int, item: Item):
Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Sat May 14 11:59:59 GMT 2022 - 519 bytes - Click Count (0) -
docs_src/query_params/tutorial006_py310.py
Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Fri Jan 07 14:11:31 GMT 2022 - 269 bytes - Click Count (0) -
tests/test_request_params/test_cookie/test_required_str.py
@app.get("/required-str") async def read_required_str(p: Annotated[str, Cookie()]): return {"p": p} class CookieModelRequiredStr(BaseModel): p: str @app.get("/model-required-str") async def read_model_required_str(p: Annotated[CookieModelRequiredStr, Cookie()]): return {"p": p.p} @pytest.mark.parametrize( "path", ["/required-str", "/model-required-str"], )
Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Sat Dec 27 18:19:10 GMT 2025 - 10.2K bytes - Click Count (0) -
docs/ru/docs/python-types.md
```Python hl_lines="1 4" {!../../docs_src/python_types/tutorial009_py39.py!} ``` Использование `Optional[str]` вместо просто `str` позволит редактору кода помочь вам обнаружить ошибки, когда вы предполагаете, что значение всегда `str`, хотя на самом деле оно может быть и `None`. `Optional[Something]` — это на самом деле сокращение для `Union[Something, None]`, они эквивалентны.Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Wed Dec 17 20:41:43 GMT 2025 - 24.4K bytes - Click Count (0) -
src/test/java/jcifs/pac/PacDataInputStreamTest.java
PacDataInputStream pdis = createInputStream(data); PacUnicodeString str = pdis.readUnicodeString(); assertEquals(4, str.getLength()); assertEquals(4, str.getMaxLength()); assertEquals(0x1234, str.getPointer()); } @Test public void testReadUnicodeStringMalformed() throws IOException { // length > maxLength
Created: Sat Dec 20 13:44:44 GMT 2025 - Last Modified: Thu Aug 14 07:14:38 GMT 2025 - 9.2K bytes - Click Count (0) -
docs_src/body/tutorial001_py39.py
Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Wed Dec 17 20:41:43 GMT 2025 - 309 bytes - Click Count (0) -
tests/test_allow_inf_nan_in_enforcing.py
b: Annotated[float, Body(allow_inf_nan=False)] = 0, ) -> str: return "OK" client = TestClient(app) @pytest.mark.parametrize( "value,code", [ ("-1", 200), ("inf", 200), ("-inf", 200), ("nan", 200), ("0", 200), ("342", 200), ], ) def test_allow_inf_nan_param_true(value: str, code: int): response = client.post(f"/?x={value}")
Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Wed Dec 17 21:25:59 GMT 2025 - 1.8K bytes - Click Count (0)