Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 3 of 3 for __str__ (0.03 sec)

  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):
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 12:54:56 UTC 2025
    - 1.8K bytes
    - Viewed (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"
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 12:54:56 UTC 2025
    - 6.8K bytes
    - Viewed (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):
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 12:54:56 UTC 2025
    - 9.2K bytes
    - Viewed (0)
Back to top