#NEWLINE# def __getitem__( self , type_params ) : #NEWLINE# #INDENT# if ( not isinstance ( key_type , tuple ) ) : #NEWLINE# #INDENT# raise TypeError ( 'Parameter to Dict type-hint must be a tuple of types: Dict[.., ..].' ) #NEWLINE# #UNINDENT# if ( len ( type_params ) != 2 ) : #NEWLINE# #INDENT# raise TypeError ( ( 'Length of parameters to a Dict type-hint must be exactly 2. Passed parameters: %s, have a length of %s.' % ( type_params , len ( type_params ) ) ) ) #NEWLINE# #UNINDENT# ( key_type , value_type ) = type_params #NEWLINE# validate_composite_type_param ( key_type , error_msg_prefix = 'Key-type parameter to a Dict hint' ) #NEWLINE# validate_composite_type_param ( value_type , error_msg_prefix = 'Value-type parameter to a Dict hint' ) #NEWLINE# return self . DictConstraint ( key_type , value_type )