Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 13 for contextmanager (0.07 sec)

  1. tests/test_dependency_after_yield_streaming.py

    from collections.abc import Generator
    from contextlib import contextmanager
    from typing import Annotated, Any
    
    import pytest
    from fastapi import Depends, FastAPI
    from fastapi.responses import StreamingResponse
    from fastapi.testclient import TestClient
    
    
    class Session:
        def __init__(self) -> None:
            self.data = ["foo", "bar", "baz"]
            self.open = True
    
        def __iter__(self) -> Generator[str, None, None]:
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 21:25:59 UTC 2025
    - 3.2K bytes
    - Viewed (0)
  2. tests/test_dependency_after_yield_websockets.py

    from collections.abc import Generator
    from contextlib import contextmanager
    from typing import Annotated, Any
    
    import pytest
    from fastapi import Depends, FastAPI, WebSocket
    from fastapi.testclient import TestClient
    
    
    class Session:
        def __init__(self) -> None:
            self.data = ["foo", "bar", "baz"]
            self.open = True
    
        def __iter__(self) -> Generator[str, None, None]:
            for item in self.data:
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 21:25:59 UTC 2025
    - 2K bytes
    - Viewed (0)
  3. docs/de/docs/tutorial/dependencies/dependencies-with-yield.md

    {* ../../docs_src/dependencies/tutorial010_py39.py hl[1:9,13] *}
    
    /// tip | Tipp
    
    Andere Möglichkeiten, einen Kontextmanager zu erstellen, sind:
    
    * <a href="https://docs.python.org/3/library/contextlib.html#contextlib.contextmanager" class="external-link" target="_blank">`@contextlib.contextmanager`</a> oder
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 14.7K bytes
    - Viewed (0)
  4. docs/es/docs/tutorial/dependencies/dependencies-with-yield.md

    ///
    
    /// note | Detalles técnicos
    
    Cualquier función que sea válida para usar con:
    
    * <a href="https://docs.python.org/3/library/contextlib.html#contextlib.contextmanager" class="external-link" target="_blank">`@contextlib.contextmanager`</a> o
    * <a href="https://docs.python.org/3/library/contextlib.html#contextlib.asynccontextmanager" class="external-link" target="_blank">`@contextlib.asynccontextmanager`</a>
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 13.7K bytes
    - Viewed (0)
  5. docs/zh/docs/tutorial/dependencies/dependencies-with-yield.md

    /// tip | 提示
    
    确保在每个依赖中只使用一次 `yield`。
    
    ///
    
    /// note | 技术细节
    
    任何一个可以与以下内容一起使用的函数:
    
    * <a href="https://docs.python.org/3/library/contextlib.html#contextlib.contextmanager" class="external-link" target="_blank">`@contextlib.contextmanager`</a> 或者
    * <a href="https://docs.python.org/3/library/contextlib.html#contextlib.asynccontextmanager" class="external-link" target="_blank">`@contextlib.asynccontextmanager`</a>
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Mon Nov 18 02:25:44 UTC 2024
    - 11.3K bytes
    - Viewed (0)
  6. docs/ja/docs/tutorial/dependencies/dependencies-with-yield.md

    ///
    
    /// note | 技術詳細
    
    以下と一緒に使用できる関数なら何でも有効です:
    
    * <a href="https://docs.python.org/3/library/contextlib.html#contextlib.contextmanager" class="external-link" target="_blank">`@contextlib.contextmanager`</a>または
    * <a href="https://docs.python.org/3/library/contextlib.html#contextlib.asynccontextmanager" class="external-link" target="_blank">`@contextlib.asynccontextmanager`</a>
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Mon Nov 18 02:25:44 UTC 2024
    - 12.3K bytes
    - Viewed (0)
  7. docs/ru/docs/tutorial/dependencies/dependencies-with-yield.md

    ///
    
    /// note | Технические детали
    
    Любая функция, с которой можно корректно использовать:
    
    * <a href="https://docs.python.org/3/library/contextlib.html#contextlib.contextmanager" class="external-link" target="_blank">`@contextlib.contextmanager`</a> или
    * <a href="https://docs.python.org/3/library/contextlib.html#contextlib.asynccontextmanager" class="external-link" target="_blank">`@contextlib.asynccontextmanager`</a>
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 19.7K bytes
    - Viewed (0)
  8. docs/pt/docs/tutorial/dependencies/dependencies-with-yield.md

    ///
    
    /// note | Detalhes Técnicos
    
    Qualquer função que possa ser utilizada com:
    
    * <a href="https://docs.python.org/3/library/contextlib.html#contextlib.contextmanager" class="external-link" target="_blank">`@contextlib.contextmanager`</a> ou
    * <a href="https://docs.python.org/3/library/contextlib.html#contextlib.asynccontextmanager" class="external-link" target="_blank">`@contextlib.asynccontextmanager`</a>
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 14.2K bytes
    - Viewed (0)
  9. docs/en/docs/tutorial/dependencies/dependencies-with-yield.md

    ///
    
    /// note | Technical Details
    
    Any function that is valid to use with:
    
    * <a href="https://docs.python.org/3/library/contextlib.html#contextlib.contextmanager" class="external-link" target="_blank">`@contextlib.contextmanager`</a> or
    * <a href="https://docs.python.org/3/library/contextlib.html#contextlib.asynccontextmanager" class="external-link" target="_blank">`@contextlib.asynccontextmanager`</a>
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 12.9K bytes
    - Viewed (0)
  10. docs/ko/docs/tutorial/dependencies/dependencies-with-yield.md

    /// tip | 팁
    
    각 의존성마다 `yield`는 한 번만 사용해야 합니다.
    
    ///
    
    /// note | 기술 세부사항
    
    다음과 함께 사용할 수 있는 모든 함수:
    
    * <a href="https://docs.python.org/3/library/contextlib.html#contextlib.contextmanager" class="external-link" target="_blank">`@contextlib.contextmanager`</a> 또는
    * <a href="https://docs.python.org/3/library/contextlib.html#contextlib.asynccontextmanager" class="external-link" target="_blank">`@contextlib.asynccontextmanager`</a>
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sun Feb 09 14:54:09 UTC 2025
    - 14.2K bytes
    - Viewed (0)
Back to top