Hi all,
This is not the first time I see this way of coding in Python and
I wonder why this is coded this way:
Howto on PyXML
(http://pyxml.sourceforge.net/topics/howto/node14.html)
shows it on this function, but I saw that in many other pieces of code:
def normalize_white space(text):
"Remove redundant whitespace from a string"
return ' '.join(text.spl it())
Is there a reason to do instead of just returning join(text.split ()) ?
why concatenate " " to the string and not just returning the string instead ?
Thanks in advance for your explanations.
Regards,
--
Stephane Ninin
Comment