#NEWLINE# def add( self , new_element , priority = 0 , force_ordering = True ) : #NEWLINE# #INDENT# '\n        adds a new item in the list.\n\n        - ``new_element`` the element to be inserted in the PriorityList\n        - ``priority`` is the priority of the element which specifies its\n        order withing the List\n        - ``force_ordering`` indicates whether elements should be ordered\n        right now. If set to False, ordering happens on demand (lazy)\n        ' #NEWLINE# self . _add_element ( new_element , priority ) #NEWLINE# if ( priority not in self . priorities ) : #NEWLINE# #INDENT# self . _add_priority ( priority , force_ordering )