Jan-14-2023, 03:19 PM
In a new version, I'm able to inject partial data
class Spam: def __init__(self): self.eggs = Inject() self.ham = Inject() def __str__(self): return f"<Spam {self.eggs} {self.ham}>" spam = Wirer(spam=Spam(), ham='HAM').spam print(spam) spam = Wirer(spam=spam, eggs='EGGS').spam print(spam)
Output:<Spam Inject(name=None) HAM>
<Spam EGGS HAM>
In fact the Wirer behaves much like the builtin partial
function. Instead of partial functions, it manipulates partial objects, or partially wired objects. This is a great paradigm!