Specifically can I provide append() a Null/None value in Python?
I am trying to add auto complete functionality to a command line application, so am using readline to obtain anything the user may have typed at the raw_input prompt.
I'm getting an issue when I try to tab (with no value entered into the console) and get this message: "append() takes exactly one argument (0 given)"
Here is the code:
tokens = readline.get_line_buffer().split()
if not tokens or readline.get_line_buffer()[-1] == ' ':
tokens.append()
I'm using the example provided here because of the traverse function where the depth of the tree isn't an issue: https://www.ironalbatross.net/wiki/index.php5?title=Python_Readline_Completions#Complex_problem_.28Regular_Grammar.29