endplay.types.suitholding

Classes:

SuitHolding([data, idx])

class endplay.types.suitholding.SuitHolding(data: Union[c_uint_Array_4, str] = '', idx: Optional[int] = None)

Bases: object

Methods:

add(rank)

Add a rank to the suit holding

clear()

Removes all cards from the holding

copy()

extend(ranks)

Add multiple ranks to the suit holding

from_pbn(pbn)

Construct a SuitHolding object from a PBN string

remove(rank)

Remove a rank from the suit holding

to_pbn()

Create a PBN representation of the suit holding

add(rank: Union[Rank, str]) bool

Add a rank to the suit holding

Parameters:

rank – The rank to add

Returns:

False if the rank was already in the holding, True otherwise

clear() None

Removes all cards from the holding

copy() SuitHolding
extend(ranks: Iterable[Rank]) int

Add multiple ranks to the suit holding

Parm ranks:

An iterable of the ranks to add

Returns:

The number of ranks successfully added

static from_pbn(pbn: str) SuitHolding

Construct a SuitHolding object from a PBN string

remove(rank: Rank) bool

Remove a rank from the suit holding

Parameters:

rank – The rank to remove

Returns:

False if the rank wasn’t in the holding, True otherwise

to_pbn() str

Create a PBN representation of the suit holding