Skip to main content

dependencies helper

Project description

dependency helper

Dependency helper for properties of python class

new_Dep = Dependencies.new("A")

class A(new_Dep):
    #  "_for" can be an array
    @new_Dep.register(_for="first_operation")[int]  # support type hinting, tested in pyright
    def number(self, value):
        return value
        
    @new_Dep.guard()
    def first_operation():
        ...
        
        
>>> a = A()
>>> a.first_operation() 
Traceback (most recent call last):
...
AttributeError: ("follow attributes are not assigned for first_operation => ", [number])

>>> a.number = 2
>>> a.first_operation()
>>>
        
 

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

deps_helper-0.1.2.tar.gz (1.5 kB view hashes)

Uploaded Source

Built Distribution

deps_helper-0.1.2-py3-none-any.whl (1.5 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page