def test_method_tuple_type():
 class x(object, ):
  def f(self):
   pass
 def f(self):
  return self
 AreEqual(type(x.f)(f, None, (int, str))(42), 42)
 AreEqual(type(x.f)(f, None, (int, str))('abc'), 'abc')
 AssertError(TypeError, type(x.f)(f, None, (int, str)), 1L)

def test_method_tuple_type ( ) : class x ( object , ) : def f ( self ) : pass def f ( self ) : return self AreEqual ( type ( x . f ) ( f , None , ( int , str ) ) ( 42 ) , 42 ) AreEqual ( type ( x . f ) ( f , None , ( int , str ) ) ( 'abc' ) , 'abc' ) AssertError ( TypeError , type ( x . f ) ( f , None , ( int , str ) ) , 1 L )
creates a method whos type is declared to be a tuple .