mirror of
https://github.com/A-Minos/nonebot-plugin-tetris-stats.git
synced 2026-03-05 05:36:54 +08:00
* 🔧 修改 basedpyright 配置 * 🚨 auto fix by pre-commit hooks --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
29 lines
636 B
Python
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__
|