MatchScore

The MatchScore dataclass is an immutable snapshot of the match score at a specific point in time. It is dynamically generated by MatchScoreHistory and should never be modified directly.

Properties

  • Name
    points_A
    Type
    int | str
    Description

    Current points of Team A (e.g., 0, 15, 30, 40, "AD").

  • Name
    points_B
    Type
    int | str
    Description

    Current points of Team B.

  • Name
    games_A
    Type
    int
    Description

    Games won by Team A in the current set.

  • Name
    games_B
    Type
    int
    Description

    Games won by Team B in the current set.

  • Name
    sets_A
    Type
    int
    Description

    Total sets won by Team A.

  • Name
    sets_B
    Type
    int
    Description

    Total sets won by Team B.

  • Name
    completed_sets
    Type
    list[tuple[int, int]]
    Description

    A history of scores from completed sets, e.g., [(6, 4), (7, 5)].

  • Name
    server
    Type
    ServingState | None
    Description

    The active serving team, serving player, receiver, and court side details encapsulated in a ServingState object (representing the setup of the upcoming/next point), or None if the match is completed.

  • Name
    in_tiebreak
    Type
    bool
    Description

    Indicates whether a regular tie-break is currently active in the current set.

  • Name
    in_super_tiebreak
    Type
    bool
    Description

    Indicates whether a match-deciding tie-break (or super tie-break) is currently active.

  • Name
    is_gold_point
    Type
    bool
    Description

    Indicates whether the current game is at 40-40 and is being decided by a Punto de Oro (Golden Point) without advantages.

String Representation

When cast to a string via print(score) or str(score), it provides a cleanly formatted tabular output, utilizing the teams' names if available:

TEAM A (I. Swiatek / Otro Jugador) | 6 4 | 3 | 30
TEAM B (E. Svitolina / Otra)       | 4 6 | 5 | 40  *

(The asterisk * indicates the team currently serving)

Was this page helpful?