Search Options

Display Count
Sort
Preferred Language
Advanced Search

Results 1 - 6 of 6 for __str__ (0.05 seconds)

  1. tests/test_inherited_custom_class.py

    import pytest
    from fastapi import FastAPI
    from fastapi.testclient import TestClient
    from pydantic import BaseModel
    
    
    class MyUuid:
        def __init__(self, uuid_string: str):
            self.uuid = uuid_string
    
        def __str__(self):
            return self.uuid
    
        @property  # type: ignore
        def __class__(self):
            return uuid.UUID
    
        @property
        def __dict__(self):
    Created: Sun Dec 28 07:19:09 GMT 2025
    - Last Modified: Sat Dec 27 12:54:56 GMT 2025
    - 1.8K bytes
    - Click Count (0)
  2. fastapi/exceptions.py

            if self.endpoint_path:
                context += f"\n    {self.endpoint_path}"
            return context
    
        def __str__(self) -> str:
            message = f"{len(self._errors)} validation error{'s' if len(self._errors) != 1 else ''}:\n"
            for err in self._errors:
                message += f"  {err}\n"
    Created: Sun Dec 28 07:19:09 GMT 2025
    - Last Modified: Sat Dec 27 12:54:56 GMT 2025
    - 6.8K bytes
    - Click Count (0)
  3. 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 Dec 28 07:19:09 GMT 2025
    - Last Modified: Sat Dec 27 12:54:56 GMT 2025
    - 9.2K bytes
    - Click Count (0)
  4. 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 Dec 28 07:19:09 GMT 2025
    - Last Modified: Wed Dec 17 21:25:59 GMT 2025
    - 2K bytes
    - Click Count (0)
  5. 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 Dec 28 07:19:09 GMT 2025
    - Last Modified: Wed Dec 17 21:25:59 GMT 2025
    - 3.2K bytes
    - Click Count (0)
  6. RELEASE.md

        truncating inputs such as from int64 to int32.
    *   Adds `tf.sparse.map_values` to apply a function to the `.value`s of
        `SparseTensor` arguments.
    *   The Python bitwise operators for `Tensor` (`__and__`, `__or__`, `__xor__`
        and `__invert__` now support non-`bool` arguments and apply the
        corresponding bitwise ops. `bool` arguments continue to be supported and
    Created: Tue Dec 30 12:39:10 GMT 2025
    - Last Modified: Tue Oct 28 22:27:41 GMT 2025
    - 740.4K bytes
    - Click Count (3)
Back to Top