GromacsWrapper
GromacsWrapper copied to clipboard
AttributeDict does not support hasattr()
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