-
-
Notifications
You must be signed in to change notification settings - Fork 44
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
super().__init__ won't accept nested dictionaries when inheriting from DotMap #77
Comments
One possible workaround is adding those constructor arguments:
Output
|
Hey @cornicis. For sure, I'd be happy to merge a PR that is passing tests and creates a new test for your new feature. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I am using DotMap as the baseclass of a custom Config-class.
As a constructor-argument I only want to pass the path to a yaml-file which holds the config values.
This works quite well if I am just using plain dictionaries without nesting:
Output:
But now with a nested dictionary this stops working:
Output:
Expected output:
I think the problem lies in using
self.__class__
instead ofDotMap
, as this will break on subclassing.Replacing all
self.__class__
occurences withDotMap
fixes the issue for me.I can create a pull request if you don't mind or else I can also implement this in a manner you find more appropriate.
The text was updated successfully, but these errors were encountered: