Search Options

Display Count
Sort
Preferred Language
Advanced Search

Results 11 - 20 of 20 for __enter__ (0.17 seconds)

  1. docs/uk/docs/tutorial/dependencies/dependencies-with-yield.md

    Це, загалом, «просунута» ідея.
    
    Якщо ви тільки починаєте з **FastAPI**, можливо, варто наразі пропустити це.
    
    ///
    
    У Python ви можете створювати Менеджери контексту, [створивши клас із двома методами: `__enter__()` і `__exit__()`](https://docs.python.org/3/reference/datamodel.html#context-managers).
    
    Ви також можете використовувати їх усередині залежностей **FastAPI** з `yield`, використовуючи
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Mar 19 18:27:41 GMT 2026
    - 18.4K bytes
    - Click Count (0)
  2. docs/es/docs/tutorial/dependencies/dependencies-with-yield.md

    Esto es, más o menos, una idea "avanzada".
    
    Si apenas estás comenzando con **FastAPI**, podrías querer omitirlo por ahora.
    
    ///
    
    En Python, puedes crear Context Managers [creando una clase con dos métodos: `__enter__()` y `__exit__()`](https://docs.python.org/3/reference/datamodel.html#context-managers).
    
    También puedes usarlos dentro de las dependencias de **FastAPI** con `yield` usando
    `with` o `async with` en la función de dependencia:
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Mar 19 18:15:55 GMT 2026
    - 13.3K bytes
    - Click Count (0)
  3. docs/ru/docs/tutorial/dependencies/dependencies-with-yield.md

    Это, более или менее, «продвинутая» идея.
    
    Если вы только начинаете работать с **FastAPI**, то лучше пока пропустить этот пункт.
    
    ///
    
    В Python можно создавать менеджеры контекста, [создав класс с двумя методами: `__enter__()` и `__exit__()`](https://docs.python.org/3/reference/datamodel.html#context-managers).
    
    Их также можно использовать внутри зависимостей **FastAPI** с `yield`, применяя операторы
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Mar 19 17:56:20 GMT 2026
    - 19.4K bytes
    - Click Count (0)
  4. docs/pt/docs/tutorial/dependencies/dependencies-with-yield.md

    Se você está apenas iniciando com o **FastAPI** você pode querer pular isso por enquanto.
    
    ///
    
    Em Python, você pode criar Gerenciadores de Contexto ao [criar uma classe com dois métodos: `__enter__()` e `__exit__()`](https://docs.python.org/3/reference/datamodel.html#context-managers).
    
    Você também pode usá-los dentro de dependências com `yield` do **FastAPI** ao utilizar
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Mar 19 18:20:43 GMT 2026
    - 13.8K bytes
    - Click Count (0)
  5. docs/de/docs/tutorial/dependencies/dependencies-with-yield.md

    Wenn Sie gerade erst mit **FastAPI** beginnen, möchten Sie das vielleicht vorerst überspringen.
    
    ///
    
    In Python können Sie Kontextmanager erstellen, indem Sie [eine Klasse mit zwei Methoden erzeugen: `__enter__()` und `__exit__()`](https://docs.python.org/3/reference/datamodel.html#context-managers).
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Mar 19 17:58:09 GMT 2026
    - 14.4K bytes
    - Click Count (0)
  6. fastapi/routing.py

        This is vendored from Starlette to avoid importing private symbols.
        """
    
        def __init__(self, cm: AbstractContextManager[_T]) -> None:
            self._cm = cm
    
        async def __aenter__(self) -> _T:
            return self._cm.__enter__()
    
        async def __aexit__(
            self,
            exc_type: type[BaseException] | None,
            exc_value: BaseException | None,
            traceback: types.TracebackType | None,
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Sun Mar 15 11:44:39 GMT 2026
    - 193K bytes
    - Click Count (0)
  7. tests/test_jsonable_encoder.py

    @dataclass
    class Item:
        name: str
        count: int
    
    
    class DictablePerson(Person):
        def __iter__(self):
            return ((k, v) for k, v in self.__dict__.items())
    
    
    class DictablePet(Pet):
        def __iter__(self):
            return ((k, v) for k, v in self.__dict__.items())
    
    
    class Unserializable:
        def __iter__(self):
            raise NotImplementedError()
    
        @property
        def __dict__(self):
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Tue Feb 17 09:59:14 GMT 2026
    - 9.2K bytes
    - Click Count (0)
  8. tests/test_dependency_after_yield_streaming.py

    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]:
            for item in self.data:
                if self.open:
                    yield item
                else:
                    raise ValueError("Session closed")
    
    
    @contextmanager
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Wed Dec 17 21:25:59 GMT 2025
    - 3.2K bytes
    - Click Count (0)
  9. tests/test_dependency_after_yield_websockets.py

    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:
                if self.open:
                    yield item
                else:
                    raise ValueError("Session closed")
    
    
    @contextmanager
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Wed Dec 17 21:25:59 GMT 2025
    - 2K bytes
    - Click Count (0)
  10. RELEASE.md

            files.
    *   Eager Execution:
        *   With eager execution Datasets can now be used as standard python
            iterators (`for batch in dataset:`). Both `Dataset.__iter__()` and
            `Dataset.make_one_shot_iterator()` can now be used to create iterators
            when eager execution is enabled.
        *   Automatic device placement has been enabled (i.e., use a GPU if
    Created: Tue Apr 07 12:39:13 GMT 2026
    - Last Modified: Mon Mar 30 18:31:38 GMT 2026
    - 746.5K bytes
    - Click Count (3)
Back to Top