[Python-bugs-list] [ python-Bugs-729103 ] Cannot retrieve name of super object

SourceForge.net noreply@sourceforge.net
Tue, 10 Jun 2003 16:44:34 -0700


Bugs item #729103, was opened at 2003-04-28 11:47
Message generated for change (Comment added) made by bcannon
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=729103&group_id=5470

Category: Type/class unification
Group: Python 2.3
Status: Open
Resolution: None
Priority: 5
Submitted By: Michele Simionato (michele_s)
Assigned to: Nobody/Anonymous (nobody)
Summary: Cannot retrieve name of super object

Initial Comment:
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/site.py", line 293, in
__call__
    return pydoc.help(*args, **kwds)
  File "/usr/local/lib/python2.3/pydoc.py", line 1539,
in __call__
    self.help(request)
  File "/usr/local/lib/python2.3/pydoc.py", line 1575,
in help
    else: doc(request, 'Help on %s:')
  File "/usr/local/lib/python2.3/pydoc.py", line 1368,
in doc
    pager(title % desc + '\n\n' + text.document(object,
name))
  File "/usr/local/lib/python2.3/pydoc.py", line 279,
in document
    if inspect.isclass(object): return
self.docclass(*args)
  File "/usr/local/lib/python2.3/pydoc.py", line 1122,
in docclass
    lambda t: t[1] == 'method')
  File "/usr/local/lib/python2.3/pydoc.py", line 1057,
in spill
    name, mod, object))
  File "/usr/local/lib/python2.3/pydoc.py", line 280,
in document
    if inspect.isroutine(object): return
self.docroutine(*args)
  File "/usr/local/lib/python2.3/pydoc.py", line 1145,
in docroutine
    realname = object.__name__
AttributeError: 'super' object has no attribute
'__name__'

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

----------------------------------------------------------------------

>Comment By: Brett Cannon (bcannon)
Date: 2003-06-10 16:44

Message:
Logged In: YES 
user_id=357491

The issue is inspect.isroutine is saying that the instance is a 
callable object since it is also a non-data descriptor.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=729103&group_id=5470