# SPDX-License-Identifier: MIT """PyPy keeps an instance with 80 or more attributes as a dict, and the hot loop runs about twice as slow (milestone 4: hm_3 and hm_4 took the TIA to 81).""" from __future__ import annotations from a2600_python.board import Board from a2600_python.cartridge import load from a2600_python.machine import VCS_NTSC def test_the_hot_objects_stay_under_eighty_attributes(): board = Board(VCS_NTSC, load(bytes(0x1000), scheme="4K").cartridge) for obj in (board, board.tia, board.riot): assert len(vars(obj)) < 80, type(obj).__name__