dependencies helper
Project description
dependency helper
Dependency helper for properties of python class
from deps_helper import Dependencies
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(self):
...
>>> 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() # OK
>>>
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.3.tar.gz
(1.5 kB
view hashes)
Built Distribution
Close
Hashes for deps_helper-0.1.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0bb11ca8027a2559c84e421567e11e400a0853daa18c91d4975785e76e5d741e |
|
MD5 | 45910d8f000b32051e792825ad4ab823 |
|
BLAKE2b-256 | 4bae5ed4e16c3b24cb28d1103ae4ca46005224b15cd966d4cf35c79b4c39780b |