typedefs

Type definitions

Users of the API can use the following structure definitions for providing arguments or checking returns (see detalis below):

E.g. the user can provide a move for the do_move() by nimgame.Move('A', 3).

This module also defines complex types and instance sets. Unlike the structure definitions above, these types and sets are not published on package level, because they are hardly ever needed for the API users. Anyway, this module can be imported, if needed, and the definitions used. See the source for details.

Complex types are used for annotations and they are unions of possible types for that element. E.g. ErrorRate_T can be a simple int or ErrorRate.

Instance sets are used for validations of input data by isinstance().

class typedefs.Move(heapdesig, removecount)

How many coins are to be removed and from what heap

property heapdesig

Alias for field number 0

property removecount

Alias for field number 1

class typedefs.ErrorRate(Computer, Player)

The required error for the parties, separately, when the program is to calculate the moves for both players

property Computer

Alias for field number 0

property Player

Alias for field number 1

class typedefs.HeapCoinRange(min, max)

Heap or coin count ranges for automatic heap setup

property max

Alias for field number 1

property min

Alias for field number 0

typedefs.ErrorRate_T

Can be an int generally, or ErrorRate for separate definition

alias of Union[int, ErrorRate]

typedefs.MyTurn_T

How the user can indicate its requirement of the starting party

alias of Union[str, bool]

typedefs.HeapCoinRange_T

Can be a sequence of int or HeapCoinRange

alias of Union[List[int], Tuple[int, int], HeapCoinRange]

typedefs.dummy()[source]

dummy, just to force sphinx.ext.viewcode to generate the source html