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: pydoc: check bases for doc strings?
Type: enhancement Stage:
Components: Library (Lib) Versions:
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: ping Nosy List: calvin, ping, skip.montanaro
Priority: low Keywords:

Created on 2001-05-23 20:18 by skip.montanaro, last changed 2022-04-10 16:04 by admin. This issue is now closed.

Messages (3)
msg4841 - (view) Author: Skip Montanaro (skip.montanaro) * (Python triager) Date: 2001-05-23 20:18
Given the following class hierarchy:

class A:
  def foo(self):
    "do the foo"
    pass

class B(A):
  def foo(self):
    pass

class C(B):
  def foo(self):
    "do the foo in C"
    pass

if you ask pydoc for help about A or C you will get the
corresponding doc string.  If you ask for help about B,
however, you see no documentation.  Would be kinda nice
if pydoc.help(B) displayed "do the foo" as the doc
string for B.foo.
msg4842 - (view) Author: Bastian Kleineidam (calvin) Date: 2001-05-28 16:34
Logged In: YES 
user_id=9205

No, please dont do this, IMO its the wrong way.
B.foo() is different from A.foo(), so it needs
a different doc string.
Just imagine I document A.foo() with "do the foo in A",
then your scheme is not working.

Bastian
msg4843 - (view) Author: Ka-Ping Yee (ping) * (Python committer) Date: 2001-08-11 20:36
Logged In: YES 
user_id=45338

I agree with Calvin.  (I remember considering this and designing it not to work this way.)  In your example, B.foo() does nothing, so it shouldn't be documented as doing what A.foo() does.  There's a link to the base class provided if you want to find out what the base class does.
History
Date User Action Args
2022-04-10 16:04:04adminsetgithub: 34536
2001-05-23 20:18:01skip.montanarocreate