Skip to content

Commit

Permalink
Use import from only for types
Browse files Browse the repository at this point in the history
  • Loading branch information
niklasf committed Jan 11, 2025
1 parent 91699cd commit 3a97469
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions chess/gaviota.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
import ctypes.util
import dataclasses
import fnmatch
import itertools
import logging
import lzma
import os
import os.path
import struct
import typing

from itertools import accumulate, permutations
from types import TracebackType
from typing import BinaryIO, Callable, Dict, List, Optional, Tuple, Type, Union

Expand Down Expand Up @@ -172,7 +172,7 @@ def init_ppp48_idx() -> Tuple[List[List[List[int]]], List[int], List[int], List[
i, j, k = ITOSQ[x] - 8, ITOSQ[y] - 8, ITOSQ[z] - 8

if idx_is_empty(ppp48_idx[i][j][k]):
for ii, jj, kk in permutations((i, j, k)):
for ii, jj, kk in itertools.permutations((i, j, k)):
ppp48_idx[ii][jj][kk] = idx
ppp48_sq_x[idx], ppp48_sq_y[idx], ppp48_sq_z[idx] = i, j, k
idx += 1
Expand Down Expand Up @@ -204,7 +204,7 @@ def init_aaidx() -> Tuple[List[int], List[List[int]]]:
def init_aaa() -> Tuple[List[int], List[List[int]]]:
# Get aaa_base.
comb = [a * (a - 1) // 2 for a in range(64)]
aaa_base = list(accumulate(comb))
aaa_base = list(itertools.accumulate(comb))

# Get aaa_xyz.
aaa_xyz = [[x, y, z] for z in range(64) for y in range(z) for x in range(y)]
Expand Down

0 comments on commit 3a97469

Please sign in to comment.