class StringList:
 def __init__(self, arg=''):
  if type(arg)==str:
   if len(arg)==0:
    self.value=[]
   else:
    self.value = arg.split()
  elif type(arg)==list:
    self.value = arg
  else:
   self.value=[ str(arg) ]

 def __str__(self):
  return ' '.join(self.value)

 def __iadd__(self, other):
  if type(other)==StringList:
   self.value = self.value + other.value
  else:
   self.value = self.value + StringList(other).value
  return self

 def __add__(self, other):
  if type(other)==StringList:
   return StringList(self.value + other.value)
  else:
   return self.__add__(StringList(other))

 def __len__(self):
  return len(self.value)

 def __print__(self):
  print self.value


# examples:

libs=StringList()
libs += """lib lib1
lib2"""

libs += 'otherlib' #no problem here
libs += ['lib3','lib4'] #this is also allowed

print libs