[ python-Bugs-933068 ] Different behaviour using super() and explicit base class.

SourceForge.net noreply at sourceforge.net
Thu Jul 15 08:35:03 CEST 2004


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

Category: Threads
Group: Python 2.3
>Status: Closed
>Resolution: Invalid
Priority: 5
Submitted By: Lawrence Allan Jones (lajones)
Assigned to: Nobody/Anonymous (nobody)
Summary: Different behaviour using super() and explicit base class.

Initial Comment:
I created a child class of threading.Thread. To invoke 
the parent __init__ method, I called super(C, 
self).__init__().

When called at run-time, Python threw an assertion 
exception informing me that the group parameter must 
be None. (The detailed error message was assert group 
is None, "group argument must be None for now".) I had 
not changed this parameter.

I created a similar class and explicitly called 
threading.Thread.__init__(). This call did not exhibit the 
fault at run-time.


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

>Comment By: Martin v. Löwis (loewis)
Date: 2004-07-15 08:35

Message:
Logged In: YES 
user_id=21627

The analysis is correct. This is not a bug in Python;
closing the report.

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

Comment By: Nick Coghlan (ncoghlan)
Date: 2004-05-10 11:52

Message:
Logged In: YES 
user_id=1038590

This looks like a usage problem to me - the call to 
super() returns an already bound method object, hence 
'self' does not need to be supplied as an argument to the 
__init__ call. 
 
That is, the correct call to fix the 'Broken' class is: 
 
super(Broken, self).__init__() 
 
 

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

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


More information about the Python-bugs-list mailing list