Describe the bug
A DirectThingClient with a read-only property will allow it to be written to.
To Reproduce
Make a DirectThingClient with a read-only property. There's an example in test_settings.py in #155 .
Expected behaviour
An exception should be raised.
Probable fix
I think the descriptor used on DirectThingClient objects does not have a __set__ method if it's read-only. This means it changes from being a data descriptor into a non-data descriptor and the object's __dict__ takes precedence. That means the first time it's written to, we don't attempt to write to the wrapped Thing and instead we just use the DirectThingClient instance __dict__.
I believe this could be fixed by adding a __set__ method that raises an exception.
Describe the bug
A
DirectThingClientwith a read-only property will allow it to be written to.To Reproduce
Make a
DirectThingClientwith a read-only property. There's an example intest_settings.pyin #155 .Expected behaviour
An exception should be raised.
Probable fix
I think the descriptor used on
DirectThingClientobjects does not have a__set__method if it's read-only. This means it changes from being a data descriptor into a non-data descriptor and the object's__dict__takes precedence. That means the first time it's written to, we don't attempt to write to the wrappedThingand instead we just use theDirectThingClientinstance__dict__.I believe this could be fixed by adding a
__set__method that raises an exception.