AttributeDict does not support hasattr()
orbeckst opened this issue · comments
AttributeDict does not support hasattr() but it should:
import gromacs
ad = gromacs.utilities.AttributeDict(a=1, b=2)
assert hasattr(ad, "a")
assert not hasattr(ad, "x") # raises AttributeError from KeyError
Using in
is a workaround:
assert "a" in ad
assert "x" not in ad
Here is my little proposal of a fix #269