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
    TeamId | None
    Description

    Indicates which team is currently serving.

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?