This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Documentation of ord(c) easy to misread
Type: enhancement Stage: resolved
Components: Documentation Versions: Python 3.6, Python 3.5
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: terry.reedy Nosy List: Susan Sun, belopolsky, benjamin.peterson, docs@python, georg.brandl, gladman, ncoghlan, python-dev, rhettinger, serhiy.storchaka, terry.reedy, vstinner
Priority: normal Keywords: easy

Created on 2016-03-10 08:51 by gladman, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Messages (12)
msg261485 - (view) Author: (gladman) Date: 2016-03-10 08:51
It is very easy to misread the greek 'nu' used in the ord(c) documentation as ord('v') (i.e. an alphabetic 'v').  This can lead the reader to draw a wrong conclusion about the behaviour of the function. 

Would it not be better if this example used a greek letter that is less easy to misread in this way?  Or, perhaps, add extra text indicating that the greek letter 'nu' is being referenced?
msg261493 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2016-03-10 11:18
I suggest to use the EURO SIGN € (U+20ac).
msg261504 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2016-03-10 15:19
Sure!
msg261527 - (view) Author: Alexander Belopolsky (belopolsky) * (Python committer) Date: 2016-03-10 22:36
Wouldn't '\N{SNAKE}' look more pythonic?  😀

>>> hex(ord('🐍'))
'0x1f40d'
msg261532 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2016-03-10 23:37
'🐍' is astral character and not all systems have fonts that support it installed by default. It can be hard to render it in TeX.
msg261561 - (view) Author: Susan Sun (Susan Sun) Date: 2016-03-11 10:57
This was changed in the following commit.

changeset:   95165:f6c6304c8193
user:        Benjamin Peterson <benjamin at python.org>
date:        Tue Mar 24 12:12:44 2015 -0400
summary:
  change Σ to ν for obscure joke reasons

https://twitter.com/ncoghlan_dev/status/579173053793353728
msg261621 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2016-03-12 00:18
The easily misread "ord('ν')" could be expanded to "ord('ν') (Greek nu)" but I agree that "ord('€') (Euro sign)" would be either better for a global doc.  (And the return is 8364.)  If no objection (Benjamin? Nick?), I am willing to do it for 3.5/6

There is no need to change the 2.7 version "ord(u'\u2020') returns 8224."
msg261682 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2016-03-13 07:24
I concur that the Euro sign would be best (more recognizable and more likely to be renderable in a given font).
msg262099 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2016-03-21 01:19
New changeset c7071c9b8c33 by Terry Jan Reedy in branch '3.5':
Issue #26525: Change ord example from nu to more easily recognized Euro sign.
https://hg.python.org/cpython/rev/c7071c9b8c33
msg262274 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2016-03-23 14:57
Reversed to ord() function chr() still uses 'ν' as an example. I think both functions should use the same example.
msg262290 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2016-03-23 17:40
New changeset f3bd94c57cd8 by Terry Jan Reedy in branch '3.5':
Issue #26525: Change chr example to match change in ord example.
https://hg.python.org/cpython/rev/f3bd94c57cd8
msg262291 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2016-03-23 17:42
Agreed.  Good catch.
History
Date User Action Args
2022-04-11 14:58:28adminsetgithub: 70712
2016-03-23 17:42:15terry.reedysetstatus: open -> closed

messages: + msg262291
2016-03-23 17:40:53python-devsetmessages: + msg262290
2016-03-23 14:57:46serhiy.storchakasetstatus: closed -> open

messages: + msg262274
2016-03-21 01:19:41terry.reedysetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2016-03-21 01:19:16python-devsetnosy: + python-dev
messages: + msg262099
2016-03-21 01:07:57terry.reedysetassignee: docs@python -> terry.reedy
2016-03-13 07:24:51rhettingersetnosy: + rhettinger
messages: + msg261682
2016-03-12 00:18:21terry.reedysetversions: + Python 3.6
nosy: + terry.reedy

messages: + msg261621

type: enhancement
stage: patch review
2016-03-11 10:57:28Susan Sunsetnosy: + ncoghlan, Susan Sun, benjamin.peterson
messages: + msg261561
2016-03-10 23:37:38serhiy.storchakasetnosy: + serhiy.storchaka
messages: + msg261532
2016-03-10 22:36:31belopolskysetnosy: + belopolsky
messages: + msg261527
2016-03-10 15:19:57georg.brandlsetmessages: + msg261504
2016-03-10 11:18:46vstinnersetkeywords: + easy
nosy: + vstinner
messages: + msg261493

2016-03-10 09:22:21serhiy.storchakasetnosy: + georg.brandl
2016-03-10 08:51:32gladmancreate