API

class compytition.rank.Rank(value: int | str, **kwargs: Any)

Bases: Ordinal

A class used to represent a Rank.

Attributes

tiedbool

a flag indicating whether the rank is tied with another

Methods

__new__(cls, value, **kwargs)

Creates a new instance of the Rank class.

__repr__()

Returns a string representation of the Rank object.

__str__()

Returns a string of the Rank object.

class compytition.ranking.Ranking(ranking: dict[Any, int | str | Rank])

Bases: dict

A class used to represent a Ranking.

This class is a dictionary subclass that maps any key to a rank, which can be an integer, a string, or a Rank object. The ranks must be consecutive and account for ties.

Attributes

rankingdict[Any, int | str | Rank]

A dictionary mapping keys to ranks.

Methods

__init__(self, ranking: dict[Any, int | str | Rank])

Initializes the Ranking with a dictionary of ranks.