Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use of super in a main class causes runtime error. #2336

Closed
ddebrunner opened this issue Feb 5, 2020 · 2 comments
Closed

Use of super in a main class causes runtime error. #2336

ddebrunner opened this issue Feb 5, 2020 · 2 comments

Comments

@ddebrunner
Copy link
Member

Having a transform (e.g. map) callable/iterable class defined in a notebook or in the main script that uses super causes Attribute error like:

AttributeError: Can't get attribute 'A' on <module '__main__' (built-in)>

Sample classes:

class A(X):
    def __init__(self)
         super().__init__()
class A(X):
    def __init__(self)
         super(A, self).__init__()

Workaround is to call the parent class method directly:

class A(X):
    def __init__(self)
         X.__init__(self)

or to define the class in its own module (not in notebook or main script)

@ddebrunner
Copy link
Member Author

This is due to: uqfoundation/dill#300

@markheger
Copy link
Member

workaround is documented, close issue

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

No branches or pull requests

2 participants