cdleonard / python-forward-property

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Python Forward Property

This is a simple module which implements automatic property forwarding.

class Inner:
    int x = 0

class Outer:
    Inner: inner
    x = forward_property("inner")

    def __init__(self):
        self.inner = Inner()

def test():
    o = Outer()
    o.x = 1
    assert o.inner.x == 1

Documentation is available on github pages

About

License:MIT License


Languages

Language:Python 100.0%