<s> """<STR_LIT>""" <EOL> class MetaMetaClass ( type ) : <EOL> def __getattribute__ ( self , name ) : <EOL> if name == '<STR_LIT>' : <EOL> return self <EOL> return type . __getattribute__ ( self , name ) <EOL> class MetaClass ( object ) : <EOL> """<STR_LIT>""" <EOL> __metaclass__ = MetaMetaClass <EOL> def __init__ ( self , name , bases , dict ) : <EOL> self . __name__ = name <EOL> self . __bases__ = bases <EOL> self . __dict__ . update ( dict ) <EOL> def __call__ ( self ) : <EOL> return OddInstance ( self ) <EOL> def __getattr__ ( self , name ) : <EOL> for b in self . __bases__ : <EOL> v = getattr ( b , name , self ) <EOL> if v is not self : <EOL> return v <EOL> raise AttributeError ( name ) <EOL> def __repr__ ( self ) : <EOL> return "<STR_LIT>" % ( self . __name__ , hex ( id ( self ) ) ) <EOL> class OddInstance ( object ) : <EOL> def __init__ ( self , cls ) : <EOL> self . __dict__ [ '<STR_LIT>' ] = cls <EOL> def __getattribute__ ( self , name ) : <EOL> dict = object . __getattribute__ ( self , '<STR_LIT>' ) <EOL> if name == '<STR_LIT>' : <EOL> return dict <EOL> v = dict . get ( name , self ) <EOL> if v is not self : <EOL> return v <EOL> return getattr ( dict [ '<STR_LIT>' ] , name ) <EOL> def __setattr__ ( self , name , v ) : <EOL> self . __dict__ [ name ] = v <EOL> def __delattr__ ( self , name ) : <EOL> del self . __dict__ [ name ] <EOL> def __repr__ ( self ) : <EOL> return "<STR_LIT>" % ( <EOL> self . __class__ . __name__ , hex ( id ( self ) ) ) <EOL> if __name__ == "<STR_LIT:__main__>" : <EOL> import doctest , __main__ <EOL> doctest . testmod ( __main__ , isprivate = lambda * a : False ) </s>
