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

Auto added attribute in config instance when hasattr is called #15

Open
tsikup opened this issue Dec 9, 2019 · 0 comments
Open

Auto added attribute in config instance when hasattr is called #15

tsikup opened this issue Dec 9, 2019 · 0 comments

Comments

@tsikup
Copy link

tsikup commented Dec 9, 2019

Issue

When hasattr() function is called on a DotMap instance (config in this case) regarding a non existing attribute, it is automatically created.

E.g. Let's say 'config' is a DotMap instance which does not have 'testAttr' as an attribute. It will be created after a hasattr() function call.

Solution

Convert DotMap instance to dict and then call hasattr, self.config.toDict().

or

replace hasattr() function with attr in self.config

I will open a pull request with my proposed solution tomorrow. 😃

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

1 participant