[docs] [issue23271] Unicode HOWTO documentation error

Dionysis Zindros report at bugs.python.org
Mon Jan 19 14:56:59 CET 2015


New submission from Dionysis Zindros:

In the Unicode HOTWO documentation for Python 2.x [0], there's an error in the fourth code sample under the section "The Unicode Type".

The code states:

```
>>> s = u'Was ever feather so lightly blown to and fro as this multitude?'
>>> s.count('e')
5
>>> s.find('feather')
9
>>> s.find('bird')
-1
>>> s.replace('feather', 'sand')
u'Was ever sand so lightly blown to and fro as this multitude?'
>>> s.upper()
u'WAS EVER FEATHER SO LIGHTLY BLOWN TO AND FRO AS THIS MULTITUDE?'
```

Notice that in the last line, "sand" was turned back into "feather". The correct last line should have been:

```
u'WAS EVER SAND SO LIGHTLY BLOWN TO AND FRO AS THIS MULTITUDE?'
```

[0] https://docs.python.org/2/howto/unicode.html

----------
assignee: docs at python
components: Documentation
messages: 234312
nosy: Dionysis.Zindros, docs at python
priority: normal
severity: normal
status: open
title: Unicode HOWTO documentation error
type: enhancement
versions: Python 2.7

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue23271>
_______________________________________


More information about the docs mailing list