Skip to content

_base#

Base Pydantic Object for Containers

LunchableModel #

Bases: BaseModel

Hashable Pydantic Model

Source code in lunchable/models/_base.py
class LunchableModel(BaseModel):
    """
    Hashable Pydantic Model
    """

    model_config = ConfigDict(extra="allow")

    def __hash__(self) -> int:
        """
        Hash Method for Pydantic BaseModels
        """
        return hash((type(self), *tuple(self.__dict__.values())))

__hash__() #

Hash Method for Pydantic BaseModels

Source code in lunchable/models/_base.py
def __hash__(self) -> int:
    """
    Hash Method for Pydantic BaseModels
    """
    return hash((type(self), *tuple(self.__dict__.values())))