Skip to content

python-chess v1.2.0

Compare
Choose a tag to compare
@niklasf niklasf released this 22 Oct 11:41
· 584 commits to master since this release
v1.2.0
New features:

* Added ``chess.Board.ply()``.
* Added ``chess.pgn.GameNode.ply()`` and ``chess.pgn.GameNode.turn()``.
* Added ``chess.engine.PovWdl``, ``chess.engine.Wdl``, and conversions from
  scores: ``chess.engine.PovScore.wdl()``, ``chess.engine.Score.wdl()``.
* Added ``chess.engine.Score(*, mate_score: int) -> int`` overload.

Changes:

* The ``PovScore`` returned by ``chess.pgn.GameNode.eval()`` is now always
  relative to the side to move. The ambiguity around ``[%eval #0]`` has been
  resolved to ``Mate(-0)``. This makes sense, given that the authors had
  standard chess in mind (where a game ending move is always a loss for the
  opponent). Previously this would be parsed as ``None``.
* Typed ``chess.engine.InfoDict["wdl"]`` as the new ``chess.engine.PovWdl``,
  rather than ``Tuple[int, int, int]``. The new type is backwards compatible,
  but it is recommended to use its documented fields and methods instead.
* Removed ``chess.engine.PovScore.__str__()``. String representation falls back
  to ``__repr__``.
* The ``en_passant`` parameter of ``chess.Board.fen()`` and
  ``chess.Board.epd()`` is now typed as ``Literal["legal", "fen", "xfen"]``
  rather than ``str``.