Skip to content

Commit a345dbd

Browse files
committed
Document board.piece_count()
1 parent efb8b42 commit a345dbd

2 files changed

Lines changed: 6 additions & 10 deletions

File tree

CHANGELOG.rst

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,6 @@
11
Changelog for python-chess
22
==========================
33

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-
134
New in v1.11.2 (25th Feb 2025)
145
------------------------------
156

chess/__init__.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -841,8 +841,13 @@ def clear_board(self) -> None:
841841
:class:`~chess.Board` also clears the move stack.
842842
"""
843843
self._clear_board()
844-
844+
845845
def piece_count(self) -> int:
846+
"""
847+
Gets the number of pieces on the board.
848+
849+
Does not include Crazyhouse pockets.
850+
"""
846851
return popcount(self.occupied)
847852

848853
def pieces_mask(self, piece_type: PieceType, color: Color) -> Bitboard:

0 commit comments

Comments
 (0)