Skip to content

Commit 3a97469

Browse files
committed
Use import from only for types
1 parent 91699cd commit 3a97469

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

chess/gaviota.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@
44
import ctypes.util
55
import dataclasses
66
import fnmatch
7+
import itertools
78
import logging
89
import lzma
910
import os
1011
import os.path
1112
import struct
1213
import typing
1314

14-
from itertools import accumulate, permutations
1515
from types import TracebackType
1616
from typing import BinaryIO, Callable, Dict, List, Optional, Tuple, Type, Union
1717

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

174174
if idx_is_empty(ppp48_idx[i][j][k]):
175-
for ii, jj, kk in permutations((i, j, k)):
175+
for ii, jj, kk in itertools.permutations((i, j, k)):
176176
ppp48_idx[ii][jj][kk] = idx
177177
ppp48_sq_x[idx], ppp48_sq_y[idx], ppp48_sq_z[idx] = i, j, k
178178
idx += 1
@@ -204,7 +204,7 @@ def init_aaidx() -> Tuple[List[int], List[List[int]]]:
204204
def init_aaa() -> Tuple[List[int], List[List[int]]]:
205205
# Get aaa_base.
206206
comb = [a * (a - 1) // 2 for a in range(64)]
207-
aaa_base = list(accumulate(comb))
207+
aaa_base = list(itertools.accumulate(comb))
208208

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

0 commit comments

Comments
 (0)