python-chess v0.10.0
New dependencies:
- If you are using Python < 3.2 you have to install
futures
in order to
use thechess.uci
module.
Changes:
-
There are big changes in the UCI module. Most notably in async mode multiple
commands can be executed at the same time (e.g.go infinite
and then
stop
orgo ponder
and thenponderhit
).go infinite
andgo ponder
will now wait for a result, i.e. you may have
to callstop
orponderhit
from a different thread or run the commands
asynchronously.stop
andponderhit
no longer have a result. -
The values of the color constants
chess.WHITE
andchess.BLACK
have been
changed. PreviouslyWHITE
was0
,BLACK
was1
. NowWHITE
isTrue
,
BLACK
isFalse
. The recommended way to invertcolor
is using
not color
. -
The pseudo piece type
chess.NONE
has been removed in favor of just using
None
. -
Changed the
Board(fen)
constructor. If the optionalfen
argument is not
given behavior did not change. However ifNone
is passed explicitly an
empty board is created. Previously the starting position would have been
set up. -
Board.fen()
will now only show completely legal en-passant squares. -
Board.set_piece_at()
andBoard.remove_piece_at()
will now clear the
move stack, because the old moves may not be valid in the changed position. -
Board.parse_uci()
andBoard.push_uci()
will now accept null moves. -
Changed shebangs from
#!/usr/bin/python
to#!/usr/bin/env python
for
better virtualenv support. -
Removed unused game data files from repository.
Bugfixes:
- PGN: Prefer the game result from the game termination marker over
*
in the
header. These should be identical in standard compliant PGNs. Thanks to
Skyler Dawson for reporting this. - Polyglot:
minimum_weight
forfind()
,find_all()
andchoice()
was
not respected. - Polyglot: Negative indexing of opening books was raising
IndexError
. - Various documentation fixes and improvements.
New features:
-
Experimental probing of Gaviota tablebases via libgtb.
-
New methods to construct boards:
>>> chess.Board.empty() Board('8/8/8/8/8/8/8/8 w - - 0 1')
>>> board, ops = chess.Board.from_epd("4k3/8/8/8/8/8/8/4K3 b - - fmvn 17; hmvc 13") >>> board Board('4k3/8/8/8/8/8/8/4K3 b - - 13 17') >>> ops {'fmvn': 17, 'hmvc': 13}
-
Added
Board.copy()
and hooks to let the copy module to the right thing. -
Added
Board.has_castling_rights(color)
,
Board.has_kingside_castling_rights(color)
and
Board.has_queenside_castling_rights(color)
. -
Added
Board.clear_stack()
. -
Support common set operations on
chess.SquareSet()
.