mirror of
https://github.com/maoakeEnterprise/amazing.git
synced 2026-04-29 00:14:34 +02:00
fix the cell pydantic cause the program was too long
This commit is contained in:
@@ -1,8 +1,10 @@
|
||||
from pydantic import BaseModel, Field
|
||||
from dataclasses import dataclass
|
||||
|
||||
|
||||
class Cell(BaseModel):
|
||||
value: int = Field(ge=0, le=15)
|
||||
@dataclass
|
||||
class Cell:
|
||||
def __init__(self, value: int) -> None:
|
||||
self.value = value
|
||||
|
||||
def __str__(self) -> str:
|
||||
return hex(self.value).removeprefix("0x").upper()
|
||||
|
||||
Reference in New Issue
Block a user