Metadata-Version: 2.1
Name: delegate-property
Version: 0.1.0
Summary: delegate attributes of a class to another attribute's properties
Home-page: https://github.com/dscottboggs/python-delegate
Author: D. Scott Boggs
Author-email: scott@tams.tech
License: UNKNOWN
Description: # Delegate
        ### A python library for delegation (the metaprogramming feature)
        
        This library adds the `@delegate` decorator which may be used to delegate
        attributes from an attribute of the existing class. For example:
        
        ```python
        from delegate import delegate
        
        class Parent:
            def __init__(self):
                self.a = "a"
                self.b = "b"
                self.d = "d"
        
        # The delegate decorator makes .a and .b available on Child, through its
        # "parent" attribute, as though Child had an a and b attribute itself.
        @delegate("a", "b", to="parent")
        class Child:
            def __init__(self):
                self.parent = Parent()
                self.c = "c"
        
        instance = Child()
        assert instance.a == "a"
        raised = False
        try:
            # But d is not available
            instance.d
        except e:
            raised = True
        
        assert raised
        ```
        
Platform: UNKNOWN
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Software Development :: Code Generators
Description-Content-Type: text/markdown
