<s> from traits . api import DelegatesTo , HasTraits , Instance , Str , TraitError <EOL> class Parent ( HasTraits ) : <EOL> first_name = Str <EOL> last_name = Str <EOL> class Child ( HasTraits ) : <EOL> first_name = Str <EOL> last_name = DelegatesTo ( '<STR_LIT>' ) <EOL> father = Instance ( Parent ) <EOL> mother = Instance ( Parent ) <EOL> tony = Parent ( first_name = '<STR_LIT>' , last_name = '<STR_LIT>' ) <EOL> alice = Parent ( first_name = '<STR_LIT>' , last_name = '<STR_LIT>' ) <EOL> sally = Child ( first_name = '<STR_LIT>' , father = tony , mother = alice ) <EOL> print sally . last_name <EOL> sally . last_name = '<STR_LIT>' <EOL> print tony . last_name <EOL> print '<STR_LIT>' <EOL> try : <EOL> sally . last_name = sally . mother <EOL> except TraitError , c : <EOL> print '<STR_LIT>' , c <EOL> """<STR_LIT>""" </s>
