Glossary: locale order

What locale was used to sort the glossary so that locale encoding comes before “list”? :slight_smile:

Thanks for noticing @Stefan2. I’ve opened a PR to correct: Fix alpha sort for glossary item locale-encoding by willingc · Pull Request #115794 · python/cpython · GitHub

2 Likes

I’ve dropped a review on the PR.

FWIW, to answer the direct question, it was presumably just a simple mistake as the glossary is sorted manually rather than by Sphinx (:sorted:) or a script—in theory, there we could add a check, fixer or :sorted: to avoid this, but it does require handling some special cases that are not strictly sorted lexicographically by their first character (e.g. future is sorted under f and not _).

1 Like

I spotted a couple more that are in the wrong alphabetical order:

“bytecode” should come before “bytes-like object”
“importer” should come before “importing”
“path based finder” should come before “path entry”
“__slots__” should come after “slice”

The question was just joking, the coincidence amused me :-). I doubt any locale would produce that order. I considered asking about automation, but also saw special cases and assumed it was deemed easier to do however it is now.

1 Like

Ah yes, I saw that as well, and wondered whether that’s intentional. Since one might want to know what importing is before learning what an importer is.

While we’re touching the bytecode entry, we could take the opportunity to add a reference link for “CPython”:

   bytecode
       Python source code is compiled into bytecode, the internal representation
-      of a Python program in the CPython interpreter.  The bytecode is also
+      of a Python program in the :term:`CPython` interpreter.  The bytecode is also

@Stefan2 Thanks for the report, the “locale encoding” one has been fixed :white_check_mark:

Would someone like to volunteer to open a PR to fix the others? :slight_smile:

Seems like a great issue especially if you are someone who isn’t yet a regular contributor to CPython :wink:

1 Like