Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 16 of 16 for __enter__ (0.1 sec)

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

    ///
    
    В Python для создания менеджеров контекста можно <a href="https://docs.python.org/3/reference/datamodel.html#context-managers" class="external-link" target="_blank">создать класс с двумя методами: `__enter__()` и `__exit__()`</a>.
    
    Вы также можете использовать их внутри зависимостей **FastAPI** с `yield`, используя операторы
    `with` или `async with` внутри функции зависимости:
    
    ```Python hl_lines="1-9  13"
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 19.5K bytes
    - Viewed (0)
  2. docs/en/docs/tutorial/dependencies/dependencies-with-yield.md

    ///
    
    In Python, you can create Context Managers by <a href="https://docs.python.org/3/reference/datamodel.html#context-managers" class="external-link" target="_blank">creating a class with two methods: `__enter__()` and `__exit__()`</a>.
    
    You can also use them inside of **FastAPI** dependencies with `yield` by using
    `with` or `async with` statements inside of the dependency function:
    
    ```Python hl_lines="1-9  13"
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 14K bytes
    - Viewed (0)
  3. docs/ja/docs/tutorial/dependencies/dependencies-with-yield.md

    これは多かれ少なかれ、「高度な」発想です。
    
    **FastAPI** を使い始めたばかりの方は、とりあえずスキップした方がよいかもしれません。
    
    ///
    
    Pythonでは、<a href="https://docs.python.org/3/reference/datamodel.html#context-managers" class="external-link" target="_blank">以下の2つのメソッドを持つクラスを作成する: `__enter__()`と`__exit__()`</a>ことでコンテキストマネージャを作成することができます。
    
    また、依存関数の中で`with`や`async with`文を使用することによって`yield`を持つ **FastAPI** の依存関係の中でそれらを使用することができます:
    
    ```Python hl_lines="1 2 3 4 5 6 7 8 9 13"
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 12.4K bytes
    - Viewed (0)
  4. docs/pt/docs/tutorial/dependencies/dependencies-with-yield.md

    ///
    
    Em python, você pode criar Gerenciadores de Contexto ao <a href="https://docs.python.org/3/reference/datamodel.html#context-managers" class="external-link" target="_blank"> criar uma classe com dois métodos: `__enter__()` e `__exit__()`</a>.
    
    Você também pode usá-los dentro de dependências com `yield` do **FastAPI** ao utilizar `with` ou `async with` dentro da função da dependência:
    
    ```Python hl_lines="1-9  13"
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 15.5K bytes
    - Viewed (0)
  5. 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):
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Thu Apr 18 21:56:59 UTC 2024
    - 9K bytes
    - Viewed (0)
  6. 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
    Registered: Tue Nov 05 12:39:12 UTC 2024
    - Last Modified: Tue Oct 22 14:33:53 UTC 2024
    - 735.3K bytes
    - Viewed (0)
Back to top