SAKryukov / python-readonly-class-attributes

Comprehensive solution for read-only Python class attributes: clear syntax, no dependency on naming conventions

Home Page:https://www.SAKryukov.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Python Readonly Class and Instance Attributes: Complete Solution

Original publication

Basic usage:

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

About

Comprehensive solution for read-only Python class attributes: clear syntax, no dependency on naming conventions

https://www.SAKryukov.org

License:MIT License


Languages

Language:Python 100.0%