# pragma mypy relaxed from typing import Callable, Any, Protocol class Data: # helper to silence ‹mypy› def __init__( self, *args: Any ) -> None: pass def record( cls: type ) -> type: class rec: def __init__( self, *args: Any ) -> None: from copy import copy counter = 0 for k, v in cls.__dict__.items(): if not k.startswith( '__' ): if len( args ) > counter: self.__dict__[ k ] = args[ counter ] else: self.__dict__[ k ] = copy( v ) counter += 1 return rec import run_tests