|
46 | 46 | PIECE_SYMBOLS = [None, "p", "n", "b", "r", "q", "k"] |
47 | 47 | PIECE_NAMES = [None, "pawn", "knight", "bishop", "rook", "queen", "king"] |
48 | 48 |
|
49 | | -def piece_symbol(piece_type: PieceType, _PIECE_SYMBOLS: List[Optional[str]] = PIECE_SYMBOLS) -> str: |
50 | | - return typing.cast(str, _PIECE_SYMBOLS[piece_type]) |
| 49 | +def piece_symbol(piece_type: PieceType) -> str: |
| 50 | + return typing.cast(str, PIECE_SYMBOLS[piece_type]) |
51 | 51 |
|
52 | 52 | def piece_name(piece_type: PieceType) -> str: |
53 | 53 | return typing.cast(str, PIECE_NAMES[piece_type]) |
@@ -211,18 +211,18 @@ def scan_forward(bb: Bitboard) -> Iterator[Square]: |
211 | 211 | def msb(bb: Bitboard) -> int: |
212 | 212 | return bb.bit_length() - 1 |
213 | 213 |
|
214 | | -def scan_reversed(bb: Bitboard, *, _BB_SQUARES: List[Bitboard] = BB_SQUARES) -> Iterator[Square]: |
| 214 | +def scan_reversed(bb: Bitboard) -> Iterator[Square]: |
215 | 215 | while bb: |
216 | 216 | r = bb.bit_length() - 1 |
217 | 217 | yield r |
218 | | - bb ^= _BB_SQUARES[r] |
| 218 | + bb ^= BB_SQUARES[r] |
219 | 219 |
|
220 | 220 | try: |
221 | 221 | # Python 3.10 |
222 | 222 | popcount = int.bit_count |
223 | 223 | except AttributeError: |
224 | | - def popcount(bb: Bitboard, *, _bin: Callable[[int], str] = bin) -> int: |
225 | | - return _bin(bb).count("1") |
| 224 | + def popcount(bb: Bitboard) -> int: |
| 225 | + return bin(bb).count("1") |
226 | 226 |
|
227 | 227 | def flip_vertical(bb: Bitboard) -> Bitboard: |
228 | 228 | # https://www.chessprogramming.org/Flipping_Mirroring_and_Rotating#FlipVertically |
|
0 commit comments