Xqt created this task.
Xqt added a project: Pywikibot.
Restricted Application added subscribers: pywikibot-bugs-list, Aklapper.

TASK DESCRIPTION

If a class is derived from multiple instances, the initializer must alway call ist super initializer even the class is derived from object. Otherwise the MRO chain is broken:

>>> class foo(object):
	def __init__(self):
		print('foo')
		
>>> class bar(object):
	def __init__(self):
		print('bar')
		
>>> class baz(foo, bar):
	def __init__(self):
		print('baz')
		super(baz, self).__init__()

>>> x = baz()
baz
foo

bar initializer isn't called here whereas the following works as expected:

>>> class foo(object):
	def __init__(self):
		print('foo')
		super(foo, self).__init__()

>>> class bar(object):
	def __init__(self):
		print('bar')
		super(bar, self).__init__()

>>> class baz(foo, bar):
	def __init__(self):
		print('baz')
		super(baz, self).__init__()

>>> x = baz()
baz
foo
bar

TASK DETAIL
https://phabricator.wikimedia.org/T212741

EMAIL PREFERENCES
https://phabricator.wikimedia.org/settings/panel/emailpreferences/

To: Xqt
Cc: Aklapper, pywikibot-bugs-list, Xqt, Wenyi, Mahveotm, Tbscho, MayS, Mdupont, JJMC89, Avicennasis, mys_721tx, jayvdb, Dalba, Masti, Alchimista, Rxy
_______________________________________________
pywikibot-bugs mailing list
pywikibot-bugs@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/pywikibot-bugs

Reply via email to