Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #92397

Python NBSP DWIM

Date 2015-06-10 08:28 -0500
From Tim Chase <python.list@tim.thechases.com>
Subject Python NBSP DWIM
Newsgroups comp.lang.python
Message-ID <mailman.339.1433943366.13271.python-list@python.org> (permalink)

Show all headers | View raw


str.split() doesn't seem to respect non-breaking space:

  Python 3.4.2 (default, Oct  8 2014, 10:45:20) 
  [GCC 4.9.1] on linux
  Type "help", "copyright", "credits" or "license" for more information.
  >>> print(repr("hello\N{NO-BREAK SPACE}world".split()))
  ['hello', 'world']

What's the purpose of a non-breaking space if it's treated like a
space for breaking/splitting purposes? :-)

Is this a bug?

-tkc



Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Python NBSP DWIM Tim Chase <python.list@tim.thechases.com> - 2015-06-10 08:28 -0500

csiph-web