Peter Otten writes: > If a "line" is defined as a string that ends with a newline > > def ends_in_asterisk(line): > return False > > would also satisfy the requirement. Lies, damned lies, and specs ;)
Even if a "line" is defined as a string that comes from reading something like a file with default options, a line may end in an asterisk. >>> [ line.endswith('*') for line in StringIO('rivi*\nrivi*\nrivi*') ] [False, False, True] -- https://mail.python.org/mailman/listinfo/python-list