#NEWLINE# def new_binding_to_class( binding_key , to_class , in_scope , get_binding_loc_fn ) : #NEWLINE# #INDENT# if ( not inspect . isclass ( to_class ) ) : #NEWLINE# #INDENT# raise errors . InvalidBindingTargetError ( get_binding_loc_fn ( ) , binding_key , to_class , 'class' ) #NEWLINE# #UNINDENT# def Proviser( injection_context , obj_provider , pargs , kwargs ) : #NEWLINE# #INDENT# return obj_provider . provide_class ( to_class , injection_context , pargs , kwargs ) #NEWLINE# #UNINDENT# def GetBindingTargetDesc( ) : #NEWLINE# #INDENT# return 'the class {0}' . format ( locations . get_name_and_loc ( to_class ) ) #NEWLINE# #UNINDENT# return Binding ( binding_key , Proviser , GetBindingTargetDesc , get_binding_loc_fn , get_binding_loc_fn )