Skip to content

Commit f3fd96d

Browse files
author
miskibin
committed
Refactor legal_moves and is_draw properties to use abstractmethod instead of abstractproperty
1 parent d352b87 commit f3fd96d

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

draughts/boards/base.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from __future__ import annotations
22

33
import re
4-
from abc import ABC, abstractproperty
4+
from abc import ABC, abstractmethod
55
from typing import Generator, Literal, Optional
66
from typing import Type
77
import numpy as np
@@ -137,8 +137,8 @@ def __init__(
137137

138138
logger.info(f"Board initialized with shape {self.shape}.")
139139

140-
# @abstractmethod
141-
@abstractproperty
140+
@property
141+
@abstractmethod
142142
def legal_moves(self) -> Generator[Move, None, None]:
143143
"""
144144
Return list legal moves for the current position.
@@ -167,7 +167,8 @@ def is_threefold_repetition(self) -> bool:
167167
return True
168168
return False
169169

170-
@abstractproperty
170+
@property
171+
@abstractmethod
171172
def is_draw(self) -> bool:
172173
...
173174

0 commit comments

Comments
 (0)