class documentation

class StringList(list):

Constructor: StringList(list_or_str)

View In Hierarchy

A microtool to join a list of strings using property as_string.

StringList can also be initialized with a string.

>>> from cocopp.toolsdivers import StringList
>>> StringList('ab bc') == ['ab', 'bc']
True
>>> word_list = StringList(['this', 'has', 'a', 'leading', 'and',
...                         'trailing', 'space'])
>>> word_list.as_string
' this has a leading and trailing space '

as_string is less typing than

>>> ' ' + ' '.join(word_list) + ' ' == word_list.as_string
True

and provides tab completion.

Method __init__ Undocumented
Property as_string return concatenation with spaces between
def __init__(self, list_or_str):

Undocumented

@property
as_string =

return concatenation with spaces between