class Foo(ReadonlyBase):
bar = 100
test = Readonly.Attribute(13)
def __init__(self, a, b):
self.a = a
self.b = Readonly.Attribute(b)
Partially based on the code sample by rIZenAShes found on GitHub
Comprehensive solution for read-only Python class attributes: clear syntax, no dependency on naming conventions
class Foo(ReadonlyBase):
bar = 100
test = Readonly.Attribute(13)
def __init__(self, a, b):
self.a = a
self.b = Readonly.Attribute(b)
Partially based on the code sample by rIZenAShes found on GitHub
Comprehensive solution for read-only Python class attributes: clear syntax, no dependency on naming conventions
MIT License