Keras-Project-Template icon indicating copy to clipboard operation
Keras-Project-Template copied to clipboard

Auto added attribute in config instance when hasattr is called

Open tsikup opened this issue 5 years ago • 0 comments

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. :smiley:

tsikup avatar Dec 09 '19 23:12 tsikup