python-configuration
python-configuration copied to clipboard
Bug: repr() is wrong for Configuration subclasses
To reproduce:
env = config.EnvConfiguration(prefix="whatever")
print(repr(env))
The expected output would be something like <EnvConfiguration: 0x123abcdef>, but instead it's always <Configuration: 0x123abcdef>
The fix for this is simple; change Configuration's implementation of __repr__() to:
def __repr__(self) -> str:
return "<%s: %s>" % (type(self).__name__, hex(id(self)))