def smart_split(text):
 text = force_unicode(text)
 for bit in smart_split_re.finditer(text):
  (yield bit.group(0))

def smart_split ( text ) : text = force_unicode ( text ) for bit in smart_split_re . finditer ( text ) : ( yield bit . group ( 0 ) )
generator that splits a string by spaces .