<s> from __future__ import absolute_import <EOL> from . . api import HasTraits , Property <EOL> class Test ( HasTraits ) : <EOL> __traits__ = { } <EOL> def __value_get ( self ) : <EOL> return self . __dict__ . get ( '<STR_LIT>' , <NUM_LIT:0> ) <EOL> def __value_set ( self , value ) : <EOL> old_value = self . __dict__ . get ( '<STR_LIT>' , <NUM_LIT:0> ) <EOL> if value != old_value : <EOL> self . _value = value <EOL> self . trait_property_changed ( '<STR_LIT:value>' , old_value , value ) <EOL> __traits__ [ '<STR_LIT:value>' ] = Property ( __value_get , __value_set ) <EOL> class Test_1 ( Test ) : <EOL> def value_changed ( self , value ) : <EOL> print '<STR_LIT>' , value <EOL> class Test_2 ( Test ) : <EOL> def anytrait_changed ( self , name , value ) : <EOL> print '<STR_LIT>' % ( name , value ) <EOL> class Test_3 ( Test_2 ) : <EOL> def value_changed ( self , value ) : <EOL> print '<STR_LIT>' , value <EOL> def on_value_changed ( value ) : <EOL> print '<STR_LIT>' , value <EOL> def on_anyvalue_changed ( value ) : <EOL> print '<STR_LIT>' , value <EOL> def test_property_notifications ( ) : <EOL> Test_1 ( ) . value = '<STR_LIT>' <EOL> Test_2 ( ) . value = '<STR_LIT>' <EOL> Test_3 ( ) . value = '<STR_LIT>' <EOL> test_4 = Test ( ) <EOL> test_4 . on_trait_change ( on_value_changed , '<STR_LIT:value>' ) <EOL> test_4 . value = '<STR_LIT>' <EOL> test_5 = Test ( ) <EOL> test_5 . on_trait_change ( on_anyvalue_changed ) <EOL> test_5 . value = '<STR_LIT>' <EOL> test_6 = Test ( ) <EOL> test_6 . on_trait_change ( on_value_changed , '<STR_LIT:value>' ) <EOL> test_6 . on_trait_change ( on_anyvalue_changed ) <EOL> test_6 . value = '<STR_LIT>' <EOL> test_7 = Test_3 ( ) <EOL> test_7 . on_trait_change ( on_value_changed , '<STR_LIT:value>' ) <EOL> test_7 . on_trait_change ( on_anyvalue_changed ) <EOL> test_7 . value = '<STR_LIT>' </s>
