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

Obscure TypeError when supplying unused kwargs to Gsolv #273

Open
a-ws-m opened this issue Sep 4, 2023 · 1 comment
Open

Obscure TypeError when supplying unused kwargs to Gsolv #273

a-ws-m opened this issue Sep 4, 2023 · 1 comment

Comments

@a-ws-m
Copy link
Contributor

a-ws-m commented Sep 4, 2023

Additional kwargs get passed to the super() class, which is Journalled. Journalled then passes them on to object, from which it inherits. This results in a slightly obscure error:

TypeError: object.__init__() takes exactly one argument (the instance to initialize)

It may be better to check for any extra keyword arguments in Journalled.__init__(), replacing the super().__init__() call.

@orbeckst
Copy link
Member

Yes, make sense.

I think when I wrote this a log time ago I was only slowly learning how to do class inheritance and using super() and friends was still a bit mystifying. There's definitely room for improvement!

Also, I don't think that the "restarting" code is particularly well tested. It seemed like a good idea at the time to make it convenient to restart, but I don't think I was a strong believer in tests then :-(.

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

No branches or pull requests

2 participants