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: In the help() function the order of methods changes
Type: enhancement Stage: resolved
Components: Documentation, Interpreter Core Versions: Python 3.3
process
Status: closed Resolution: wont fix
Dependencies: Superseder:
Assigned To: docs@python Nosy List: Ramchandra Apte, docs@python, py.user, r.david.murray
Priority: normal Keywords:

Created on 2013-02-14 10:56 by py.user, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Messages (3)
msg182086 - (view) Author: py.user (py.user) * Date: 2013-02-14 10:56
>>> class A:
...   '''class'''
...   def c(self):
...     '''c doc'''
...     pass
...   def b(self):
...     '''b doc'''
...     pass
...   def a(self):
...     '''a doc'''
...     pass
... 
>>> help(A)

class A(builtins.object)
 |  class
 |  
 |  Methods defined here:
 |  
 |  a(self)
 |      a doc
 |  
 |  b(self)
 |      b doc
 |  
 |  c(self)
 |      c doc
 |  
 

When I have many methods ordered in the source in readable order, the help() function is mixing them, so the last method goes to the top and the first method goes to the bottom.

I would like to have an option, whether I want sort them or not.
msg182095 - (view) Author: Ramchandra Apte (Ramchandra Apte) * Date: 2013-02-14 13:30
Sorry, but there is no way of telling the order as methods are respresented internally as a dictionary. Please close this as invalid.
msg182109 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2013-02-14 16:14
Ramchandra is correct.  If you were to implement a "don't sort" flag, what you would get is *random* order (and a different order each time, in 3.3+).

Further, this is Python-interpreter internal data structure we are talking about, so it isn't even an option to use OrderedDict in pydoc.

I'm closing this as "won't fix" because it would certainly be nice to have this ability...but there is no practical way to implement it.
History
Date User Action Args
2022-04-11 14:57:41adminsetgithub: 61407
2013-02-14 16:14:56r.david.murraysetstatus: open -> closed

nosy: + r.david.murray
messages: + msg182109

resolution: wont fix
stage: resolved
2013-02-14 13:30:24Ramchandra Aptesetnosy: + Ramchandra Apte
messages: + msg182095
2013-02-14 10:56:30py.usercreate