#NEWLINE# def append( self , * value , **key_and_value ) : #NEWLINE# #INDENT# '\n        Append an item to the list, either given as plain value or as a\n        keyword-arg pair.\n        Example:\n            taggedlist.append(4)\n        or\n            taggedlist.append(k=4)\n        ' #NEWLINE# if ( ( len ( value ) == 1 ) and ( not key_and_value ) ) : #NEWLINE# #INDENT# key = None #NEWLINE# value = value [ 0 ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( ( len ( key_and_value ) == 1 ) and ( not value ) ) : #NEWLINE# #INDENT# [ ( key , value ) ] = key_and_value . items ( ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# raise ValueError ( 'Only either one single value or one single pair of key/value is allowed' ) #NEWLINE# #UNINDENT# #UNINDENT# self . values . append ( value ) #NEWLINE# self . keys . append ( key )