Message11085

Author stefan.richthofer
Recipients asmeurer, stefan.richthofer
Date 2017-02-08.16:08:39
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1486570120.8.0.918394117733.issue2551@psf.upfronthosting.co.za>
In-reply-to
Content
#2475 and #1777 both suffer the issue that Jython emits

TypeError: Error when calling the metaclass bases
    multiple bases have instance lay-out conflict

under certain __slot__ usage. While in #1777 it was suggested to simply avoid using __slots__ in Jython, which is actually a suitable workaround as proposed in https://github.com/sympy/sympy/pull/12120, that hint stems from a time when Jython had no __slots__ support at all.
Given that this issue also occurs elsewhere and nowadays __slots__ is actually supported in Jython we might better get this fixed. In case this issue turns out to be fixable with some reasonable effort I would withdraw https://github.com/sympy/sympy/pull/12120 in favor of a Jython-side solution.

I undertook the effort to boil it down to following diamond-style configuration:

class test1(object):
    __slots__ = ('a',)

class test2_1(test1):
    __slots__ = ()

class test2_2(test1):
    __slots__ = ()

class test3(test2_1, test2_2):
    pass


which fails in Jython, but passes in CPython.
Same behavior if either test2_1 or test2_2 have some value in __slots__, e.g. ('b') or also ('a') (name seems not to matter).

On the other hand if test2_1 and test2_2 both have some value in __slots__, e.g. ('b'), ('c') (but same with ('a'), ('a') or so, name doesn't matter here either) this fails in CPython too with the same error.

This issue might or might not be related to #2101 / #1996, cannot tell yet.
History
Date User Action Args
2017-02-08 16:08:40stefan.richthofersetrecipients: + stefan.richthofer, asmeurer
2017-02-08 16:08:40stefan.richthofersetmessageid: <1486570120.8.0.918394117733.issue2551@psf.upfronthosting.co.za>
2017-02-08 16:08:40stefan.richthoferlinkissue2551 messages
2017-02-08 16:08:39stefan.richthofercreate