Tags: seekinglambda/python-chess
Tags
python-chess v1.3.2 Bugfixes: * Added a new reason for ``board.status()`` to be invalid: ``chess.STATUS_IMPOSSIBLE_CHECK``. This detects positions where two sliding pieces are giving check while also being aligned with the king on the same rank, file, or diagonal. Such positions are impossible to reach, break Stockfish, and maybe other engines.
python-chess v1.3.0 Changes: * Introduced ``chess.pgn.ChildNode``, a subclass of ``chess.pgn.GameNode`` for all nodes other than the root node, and converted ``chess.pgn.GameNode`` to an abstract base class. This improves ergonomics in typed code. The change is backwards compatible if using only documented features. However, a notable undocumented feature is the ability to create dangling nodes. This is no longer possible. If you have been using this for subclassing, override ``GameNode.add_variation()`` instead of ``GameNode.dangling_node()``. It is now the only method that creates child nodes. Bugfixes: * Removed broken ``weakref`` based caching in ``chess.pgn.GameNode.board()``. New features: * Added ``chess.pgn.GameNode.next()``.
python-chess v1.2.1 The primary location for the published package is now https://pypi.org/project/chess/. Thanks to `Kristian Glass <https://github.com/doismellburning>`_ for transferring the namespace. The old https://pypi.org/project/python-chess/ will remain an alias that installs the package from the new location as a dependency (as recommended by `PEP423 <https://www.python.org/dev/peps/pep-0423/#how-to-rename-a-project>`_).
python-chess 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``.
python-chess v1.1.0 New features: * Added `chess.svg.board(..., orientation)`. This is a more idiomatic way to set the board orientation than `flipped`. * Added `chess.svg.Arrow.pgn()` and `chess.svg.Arrow.from_pgn()`. Changes: * Further relaxed `chess.Board.parse_san()`. Now accepts fully specified moves like `e2e4`, even if that is not a pawn move, castling notation with zeros, null moves in UCI notation, and null moves in XBoard notation.
python-chess v1.0.0 Changes: * Now requires Python 3.7+. * `chess.engine` will now cut off illegal principal variations at the first illegal move instead of discarding them entirely. * `chess.engine.EngineProtocol` renamed to `chess.engine.Protocol`. * `chess.engine.Option` is no longer a named tuple. * Renamed `chess.gaviota` internals. * Relaxed type annotations of `chess.pgn.GameNode.variation()` and related methods. * Changed default colors of `chess.svg.Arrow` and `chess.pgn.GameNode.arrows()`. These can be overriden with the new `chess.svg.board(..., colors)` feature. * Documentation improvements. Will now show type aliases like `chess.Square` instead of `int`. Bugfixes: * Fix insufficient material with same-color bishops on both sides. * Clarify that `chess.Board.can_claim_draw()` and related methods refer to claims by the player to move. Three-fold repetition could already be claimed before making the final repeating move. `chess.Board.can_claim_fifty_moves()` now also allows a claim before the final repeating move. The previous behavior is `chess.Board.is_fifty_moves()`. * Fix parsing of green arrows/circles in `chess.pgn.GameNode.arrows()`. * Fix overloaded type signature of `chess.engine.Protocol.engine()`. New features: * Added `chess.parse_square()`, to be used instead of `chess.SQUARE_NAMES.index()`. * Added `chess.Board.apply_mirror()`. * Added `chess.svg.board(..., colors)`, to allow overriding the default theme.
python-chess v0.31.4 Bugfixes: * Fix inconsistency where `board.is_legal()` was not accepting castling moves in Chess960 notation (when board is in standard mode), while all other methods did. * Fix `chess.pgn.GameNode.set_clock()` with negative or floating point values. * Avoid leading and trailing spaces in PGN comments when setting annotations. New features: * Finish typing and declare support for mypy.
PreviousNext