Skip to content

python-chess v0.31.0

Compare
Choose a tag to compare
@niklasf niklasf released this 21 Apr 19:17
· 821 commits to master since this release
v0.31.0
Changes:

* Replaced lookup table `chess.BB_BETWEEN[a][b]` with a function
  `chess.between(a, b)`. Improves initialization and runtime performance.
* `chess.pgn.BaseVisitor.result()` is now an abstract method, forcing
  subclasses to implement it.
* Removed helper attributes from `chess.engine.InfoDict`. Instead it is now
  a `TypedDict`.
* `chess.engine.PovScore` equality is now semantic instead of structural:
  Scores compare equal to the negative score from the opposite point of view.

Bugfixes:

* `chess.Board.is_irreversible()` now considers ceding legal en-passant
  captures as irreversible. Also documented that false-negatives due to forced
  lines are by design.
* Fixed stack overflow in `chess.pgn` when exporting, visiting or getting the
   final board of a very long game.
* Clarified documentation regarding board validity.
* `chess.pgn.GameNode.__repr__()` no longer errors if the root node has invalid
  FEN or Variant headers.
* Carriage returns are no longer allowed in PGN header values, fixing
  reparsability.
* Fixed type error when XBoard name or egt features have a value that looks
  like an integer.
* `chess.engine` is now passing type checks with mypy.
* `chess.gaviota` is now passing type checks with mypy.

Features:

* Added `chess.Board.gives_check()`.
* `chess.engine.AnalysisResult.wait()` now returns `chess.engine.BestMove`.
* Added `empty_square` parameter for `chess.Board.unicode()` with better
  aligned default (⭘).