Search Options

Display Count
Sort
Preferred Language
Advanced Search

Results 1 - 5 of 5 for __aiter__ (0.47 seconds)

  1. 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)
  2. 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)
  3. 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)
  4. docs_src/dependencies/tutorial010_py310.py

    class MySuperContextManager:
        def __init__(self):
            self.db = DBSession()
    
        def __enter__(self):
            return self.db
    
        def __exit__(self, exc_type, exc_value, traceback):
            self.db.close()
    
    
    async def get_db():
        with MySuperContextManager() as db:
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Feb 12 13:19:43 GMT 2026
    - 292 bytes
    - Click Count (0)
  5. fastapi/concurrency.py

        # since we're creating a new limiter for each call, any non-zero limit
        # works (1 is arbitrary)
        exit_limiter = CapacityLimiter(1)
        try:
            yield await run_in_threadpool(cm.__enter__)
        except Exception as e:
            ok = bool(
                await anyio.to_thread.run_sync(
                    cm.__exit__, type(e), e, e.__traceback__, limiter=exit_limiter
                )
            )
            if not ok:
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Wed Dec 17 21:25:59 GMT 2025
    - 1.5K bytes
    - Click Count (0)
Back to Top