#NEWLINE# def test_link_event( self ) : #NEWLINE# #INDENT# canary = [ ] #NEWLINE# class Collection ( list ) : #NEWLINE# #INDENT# @ collection . linker #NEWLINE# def _on_link( self , obj ) : #NEWLINE# #INDENT# canary . append ( obj ) #NEWLINE# #UNINDENT# #UNINDENT# class Foo ( object ) : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# instrumentation . register_class ( Foo ) #NEWLINE# attributes . register_attribute ( Foo , 'attr' , uselist = True , typecallable = Collection , useobject = True ) #NEWLINE# f1 = Foo ( ) #NEWLINE# f1 . attr . append ( 3 ) #NEWLINE# eq_ ( canary , [ f1 . attr . _sa_adapter ] ) #NEWLINE# adapter_1 = f1 . attr . _sa_adapter #NEWLINE# l2 = Collection ( ) #NEWLINE# f1 . attr = l2 #NEWLINE# eq_ ( canary , [ adapter_1 , l2 . attr . _sa_adapter , None ] )