Files
呵呵です fcecf5a01f 🔧 修改 basedpyright 配置 (#573)
* 🔧 修改 basedpyright 配置

* 🚨 auto fix by pre-commit hooks

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2025-12-25 22:32:25 +08:00

29 lines
636 B
Python

from abc import ABC, abstractmethod
from typing import Generic, TypeVar
from pydantic import BaseModel
from typing_extensions import override
from ..utils.typedefs import GameType
T = TypeVar('T', bound=GameType)
class BaseUser(BaseModel, ABC, Generic[T]):
"""游戏用户"""
platform: T
@override
def __eq__(self, other: object) -> bool:
if isinstance(other, BaseUser):
return self.unique_identifier == other.unique_identifier
return False
@property
@abstractmethod
def unique_identifier(self) -> str:
raise NotImplementedError
__hash__ = BaseModel.__hash__