Skip to content

Commit

Permalink
Fix docstrings
Browse files Browse the repository at this point in the history
Fixed some docstrings.
  • Loading branch information
Boštjan Mejak committed Aug 15, 2020
1 parent dfaa8fa commit 4435194
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions chess/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3660,25 +3660,25 @@ def __len__(self) -> int:
# MutableSet

def add(self, square: Square) -> None:
"""Adds a square to the set."""
"""Adds a square to a set."""
self.mask |= BB_SQUARES[square]

def discard(self, square: Square) -> None:
"""Discards a square from the set."""
"""Discards a square from a set."""
self.mask &= ~BB_SQUARES[square]

# frozenset

def isdisjoint(self, other: IntoSquareSet) -> bool:
"""Test if the square sets are disjoint."""
"""Tests if square sets are disjoint."""
return not bool(self & other)

def issubset(self, other: IntoSquareSet) -> bool:
"""Test if this square set is a subset of another."""
"""Tests if this square set is a subset of another."""
return not bool(~self & other)

def issuperset(self, other: IntoSquareSet) -> bool:
"""Test if this square set is a superset of another."""
"""Tests if this square set is a superset of another."""
return not bool(self & ~SquareSet(other))

def union(self, other: IntoSquareSet) -> SquareSet:
Expand Down Expand Up @@ -3750,9 +3750,9 @@ def __ixor__(self, other: IntoSquareSet) -> SquareSet:

def remove(self, square: Square) -> None:
"""
Removes a square from the set.
Removes the given *square* from a set.
:raises: :exc:`KeyError` if the given square was not in the set.
:raises: :exc:`KeyError` if the given square was not in a set.
"""
mask = BB_SQUARES[square]
if self.mask & mask:
Expand All @@ -3762,7 +3762,7 @@ def remove(self, square: Square) -> None:

def pop(self) -> Square:
"""
Removes a square from the set and returns it.
Removes a square from a set and returns it.
:raises: :exc:`KeyError` on an empty set.
"""
Expand All @@ -3774,21 +3774,21 @@ def pop(self) -> Square:
return square

def clear(self) -> None:
"""Remove all elements from this set."""
"""Removes all elements from this set."""
self.mask = BB_EMPTY

# SquareSet

def carry_rippler(self) -> Iterator[Bitboard]:
"""Iterator over the subsets of this set."""
"""Iterates over subsets of this set."""
return _carry_rippler(self.mask)

def mirror(self) -> SquareSet:
"""Returns a vertically mirrored copy of this square set."""
return SquareSet(flip_vertical(self.mask))

def tolist(self) -> List[bool]:
"""Convert the set to a list of 64 bools."""
"""Converts a set to a list of 64 bools."""
result = [False] * 64
for square in self:
result[square] = True
Expand Down Expand Up @@ -3850,7 +3850,7 @@ def _repr_svg_(self) -> str:
@classmethod
def ray(cls, a: Square, b: Square) -> SquareSet:
"""
All squares on the rank, file or diagonal with the two squares, if they
Marks all squares on the rank, file or diagonal with the two squares, if they
are aligned.
>>> import chess
Expand All @@ -3870,7 +3870,7 @@ def ray(cls, a: Square, b: Square) -> SquareSet:
@classmethod
def between(cls, a: Square, b: Square) -> SquareSet:
"""
All squares on the rank, file or diagonal between the two squares
Marks all squares on the rank, file or diagonal between the two squares
(bounds not included), if they are aligned.
>>> import chess
Expand Down

0 comments on commit 4435194

Please sign in to comment.