def assert_manual_typechecking(bad_grammar, test_obj):
 for (attr, value) in bad_grammar:
  with nt.assert_raises(ValueError) as err:
   setattr(test_obj, attr, value)
  nt.assert_equal(err.expected, ValueError)

def assert_manual_typechecking ( bad_grammar , test_obj ) : for ( attr , value ) in bad_grammar : with nt . assert_raises ( ValueError ) as err : setattr ( test_obj , attr , value ) nt . assert_equal ( err . expected , ValueError )
some attrs use the _assert_is_type func for typechecking .