You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Traceback (most recent call last):
File "cococlassmethod.py", line 2074, in <module>
B().method({'somekey': 'string', 'someotherkey': 42})
File "cococlassmethod.py", line 2070, in method
return (super().method(rest))
File "cococlassmethod.py", line 29, in _coconut_super
return _coconut_py_super(cls, self)
TypeError: super(type, obj): obj must be an instance or subtype of type
It seems the code that's supposed to make parameterless super() possible on older python versions doesn't handle the pattern-matching part correctly. I looked into this a bit and it seems the part where the super-implementation tries to get the self it fetches some tuple instead.
This was a very tricky bug; thanks for finding this! Should be all fixed now on coconut-develop>=3.0.0-a_dev23 (pip install -U coconut-develop to get the fix). Fix should make the above code work on any target, and should make super correctly use the built-in super on targets >= 3.
A call to
super
inside a pattern-matching method that's defined as a classmethod fails withTypeError
:It seems the code that's supposed to make parameterless
super()
possible on older python versions doesn't handle the pattern-matching part correctly. I looked into this a bit and it seems the part where thesuper
-implementation tries to get theself
it fetches some tuple instead.What I'm a bit surprised by is that coconut compiles this super even on targets like 3.11 where parameterless super is supported.
The text was updated successfully, but these errors were encountered: