Skip to content
This repository has been archived by the owner on Mar 23, 2023. It is now read-only.

Behavior difference of super with CPython #217

Open
S-YOU opened this issue Jan 26, 2017 · 1 comment
Open

Behavior difference of super with CPython #217

S-YOU opened this issue Jan 26, 2017 · 1 comment

Comments

@S-YOU
Copy link
Contributor

S-YOU commented Jan 26, 2017

For the given code:

class A(tuple):
  def __init__(self, arg=None):
    print super(A, self)
    print super(A, self).__init__
    super(A, self).__init__(arg)

print A([1,2,3])
--- CPython Grumpy
super(A, self) <super: <class 'A'>, <A object>> <super object at 0xc4203b8d80>
super(A, self).__init__ <method-wrapper '__init__' of A object at 0x1024d1110> <bound method super.__init__ of <super object at 0xc4203b8e10>>
super(A, self).__init__(arg) (1, 2, 3) TypeError: '__init__' requires 2 arguments
@trotterdylan
Copy link
Contributor

Thanks for reporting this! I took a quick look at this but wasn't able to figure out the exact problem. I suspect it'll be a pretty simple fix once it's clear exactly what's happening.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants