#NEWLINE# def __init__( self , trait_type = List , id = None , **metadata ) : #NEWLINE# #INDENT# ' Constructor. ' #NEWLINE# metadata [ '__extension_point__' ] = True #NEWLINE# super ( ExtensionPoint , self ) . __init__ ( ** trait_type ) #NEWLINE# if inspect . isclass ( trait_type ) : #NEWLINE# #INDENT# trait_type = trait_type ( ) #NEWLINE# #UNINDENT# if ( not isinstance ( trait_type , List ) ) : #NEWLINE# #INDENT# raise TypeError ( ( INVALID_TRAIT_TYPE % trait_type ) ) #NEWLINE# #UNINDENT# self . trait_type = trait_type #NEWLINE# if ( id is None ) : #NEWLINE# #INDENT# raise ValueError ( 'an extension point must have an Id' ) #NEWLINE# #UNINDENT# self . id = id #NEWLINE# self . _obj_to_listeners_map = weakref . WeakKeyDictionary ( ) #NEWLINE# return