We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent efb8b42 commit a345dbdCopy full SHA for a345dbd
2 files changed
CHANGELOG.rst
@@ -1,15 +1,6 @@
1
Changelog for python-chess
2
==========================
3
4
-New in unreleased (27th Mar 2026)
5
----------------------------------
6
-
7
-Bugfixes:
8
-* Fixed typo in README.rst.
9
10
-Changes:
11
-* Added ``board.piece_count`` function.
12
13
New in v1.11.2 (25th Feb 2025)
14
------------------------------
15
chess/__init__.py
@@ -841,8 +841,13 @@ def clear_board(self) -> None:
841
:class:`~chess.Board` also clears the move stack.
842
"""
843
self._clear_board()
844
+
845
def piece_count(self) -> int:
846
+ """
847
+ Gets the number of pieces on the board.
848
849
+ Does not include Crazyhouse pockets.
850
851
return popcount(self.occupied)
852
853
def pieces_mask(self, piece_type: PieceType, color: Color) -> Bitboard:
0 commit comments