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.

Title: Cannot retrieve name of super object
Type: Stage:
Components: Interpreter Core Versions: Python 2.3
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: georg.brandl Nosy List: brett.cannon, georg.brandl, georg.brandl, michele_s
Priority: low Keywords:

Created on 2003-04-28 18:47 by michele_s, last changed 2022-04-10 16:08 by admin. This issue is now closed.

Messages (6)
msg15725 - (view) Author: Michele Simionato (michele_s) Date: 2003-04-28 18:47
I see that in Python 2.3b1 many problems of super
have been fixed, but this one is still there:
I cannot retrieve the __name__ of a super object.
This generates problems with pydoc, for instance:

>>> class C(B):
...     sup=super(B)
>>> help(C)
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "/usr/local/lib/python2.3/", line 293, in
    return*args, **kwds)
  File "/usr/local/lib/python2.3/", line 1539,
in __call__
  File "/usr/local/lib/python2.3/", line 1575,
in help
    else: doc(request, 'Help on %s:')
  File "/usr/local/lib/python2.3/", line 1368,
in doc
    pager(title % desc + '\n\n' + text.document(object,
  File "/usr/local/lib/python2.3/", line 279,
in document
    if inspect.isclass(object): return
  File "/usr/local/lib/python2.3/", line 1122,
in docclass
    lambda t: t[1] == 'method')
  File "/usr/local/lib/python2.3/", line 1057,
in spill
    name, mod, object))
  File "/usr/local/lib/python2.3/", line 280,
in document
    if inspect.isroutine(object): return
  File "/usr/local/lib/python2.3/", line 1145,
in docroutine
    realname = object.__name__
AttributeError: 'super' object has no attribute

P.S. I seem to remember I already submitted this
bug (or feature request, as you wish ;) but I don't
find it in bugtracker and I had no feedback; maybe
it wasn't sent at all due to some connection problem.
If not, please accept my apologies.

    Michele Simionato
msg15726 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2003-06-10 23:44
Logged In: YES 

The issue is inspect.isroutine is saying that the instance is a 
callable object since it is also a non-data descriptor.
msg15727 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2003-06-11 23:39
Logged In: YES 

Patched pydoc (revision 1.84) to try an object as "other" if what 
inspect identifies it as does not work based on its assumptions.
msg15728 - (view) Author: Michele Simionato (michele_s) Date: 2003-08-19 00:23
Logged In: YES 

I've just checked today with Python 2.3 (pydoc
revision 1.86):

class B(object):

class C(B):


still gives the same error!

What happened? Did you forgot to add the patch to 
the standard distribution? The bug is not close!
msg15729 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2003-08-28 00:18
Logged In: YES 

The patch was applied.  It's possible one of the subsequent 
patches broke it.

Opening patch again.
msg15730 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2005-10-01 16:34
Logged In: YES 

Fixed in Lib/ r1.107,
Date User Action Args
2022-04-10 16:08:25adminsetgithub: 38390
2003-04-28 18:47:53michele_screate