class documentation
class Stripper: (source)
Given a series of lines, find the common prefix and strip it from them. >>> lines = [ ... 'abcdefg\n', ... 'abc\n', ... 'abcde\n', ... ] >>> res = Stripper.strip_prefix(lines) >>> res.prefix 'abc' >>> list(res.lines) ['defg\n', '\n', 'de\n'] If no prefix is common, nothing should be stripped. >>> lines = [ ... 'abcd\n', ... '1234\n', ... ] >>> res = Stripper.strip_prefix(lines) >>> res.prefix = '' >>> list(res.lines) ['abcd\n', '1234\n']
Class Method | strip |
Undocumented |
Static Method | common |
Return the common prefix of two lines. |
Method | __call__ |
Undocumented |
Method | __init__ |
Undocumented |
Instance Variable | lines |
Undocumented |
Instance Variable | prefix |
Undocumented |