Message234312
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 |
|
Date |
User |
Action |
Args |
2015-01-19 13:56:59 | Dionysis.Zindros | set | recipients:
+ Dionysis.Zindros, docs@python |
2015-01-19 13:56:59 | Dionysis.Zindros | set | messageid: <1421675819.3.0.538078693406.issue23271@psf.upfronthosting.co.za> |
2015-01-19 13:56:59 | Dionysis.Zindros | link | issue23271 messages |
2015-01-19 13:56:58 | Dionysis.Zindros | create | |
|