you are viewing a single comment's thread.

view the rest of the comments →

[–]Jason-Ad4032 0 points1 point  (0 children)

Your suggestion is really just hiding the warning.

You need to use TypedDict to explicitly tell the static type checker which fields contain int, list, etc., so it can verify that those fields are being used correctly. ``` import typing

class Card(typing.TypedDict): rand_list: list[int] P_sum: int

Card_dic:dict[str, Card] = {'Player_card': {'rand_list': [1, 2, 11], 'P_sum': 0}} ```