DottedDict icon indicating copy to clipboard operation
DottedDict copied to clipboard

hasattr() throws an exception when called on DottedDict

Open RusAD32 opened this issue 5 years ago • 0 comments
trafficstars

hasattr() in python is implemented by calling __getattr__ and checking whether it threw AttributeError. Since for DottedDict __getattr__ = __getitem__, a KeyError is thrown and not AttributeError, therefore hasattr can fall with an exception instead of returning False

The simplest fix that I came up with is in pr #14

RusAD32 avatar Mar 02 '20 13:03 RusAD32