Issue 933068: Different behaviour using super() and explicit base class. (original) (raw)

Issue933068

Created on 2004-04-11 03:59 by lajones, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
scratch2.py lajones,2004-04-11 03:59 Unit test that exhibits failure (testBroken asserts that the caller raises the assertion error).
Messages (3)
msg20478 - (view) Author: Lawrence Allan Jones (lajones) Date: 2004-04-11 03:59
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.
msg20479 - (view) Author: Alyssa Coghlan (ncoghlan) * (Python committer) Date: 2004-05-10 09:52
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__()
msg20480 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2004-07-15 06:35
Logged In: YES user_id=21627 The analysis is correct. This is not a bug in Python; closing the report.
History
Date User Action Args
2022-04-11 14:56:03 admin set github: 40140
2004-04-11 03:59:10 lajones create