#NEWLINE# def test_extended( self ) : #NEWLINE# #INDENT# ' Tests a dynamic trait change handler using extended names. ' #NEWLINE# class Child ( HasTraits ) : #NEWLINE# #INDENT# i = Int #NEWLINE# #UNINDENT# class Parent ( HasTraits ) : #NEWLINE# #INDENT# child = Instance ( Child ) #NEWLINE# #UNINDENT# parent = Parent ( child = Child ( ) ) #NEWLINE# target = HasTraits ( ) #NEWLINE# self . count = 0 #NEWLINE# def count_notifies( ) : #NEWLINE# #INDENT# self . count += 1 #NEWLINE# #UNINDENT# parent . on_trait_change ( count_notifies , 'child:i' , target = target ) #NEWLINE# parent . child . i = 10 #NEWLINE# del target #NEWLINE# parent . child . i = 0 #NEWLINE# self . assertEqual ( self . count , 1 )