On Wed, Oct 23, 2019 at 5:53 PM Andrew Barnert via Python-ideas <
[email protected]> wrote:
> > To be fair, I also don't know which of those split on str.split() with
> no arguments to the method either.
>
I couldn't resist -- the answer is most of them:
#!/usr/bin/env python
weird_spaces = ("x\u0020x\u00A0x\u1680x\u180Ex\u2000x\u2001x\u2002"
"x\u2003x\u2004x\u2005x\u2006x\u2007x\u2008x\u2009"
"x\u200Ax\u200Bx\u202Fx\u205Fx\u3000x\uFEFFx")
print(weird_spaces)
splitted = weird_spaces.split()
print(splitted)
print(len(weird_spaces))
print(len(splitted))
$ python weird_spaces.py
x x x xx x x x x x x x x x x xx x x xx
['x', 'x', 'x', 'x\u180ex', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x',
'x', 'x\u200bx', 'x', 'x', 'x\ufeffx']
41
18
-CHB
--
Christopher Barker, PhD
Python Language Consulting
- Teaching
- Scientific Software Development
- Desktop GUI and Web Development
- wxPython, numpy, scipy, Cython
_______________________________________________
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at
https://mail.python.org/archives/list/[email protected]/message/PELOTR3J4HV2EIF54ZHISWZZX45QJY7U/
Code of Conduct: http://python.org/psf/codeofconduct/