This is cool! I was hoping it would look something like:
‘’’ import diagrams calc_d = diagrams.new_diagram(“calculator_123”)
calc_d.Datum("SuperNumber") class SuperNumber(int): pass
@calc_d.Service(“Calculator”, “takes numbers and operations and operates”) class Calculator(object): @calc_d.Endpoint("Add", calls=["Increment"], main_data={"b": "SuperNumber}) def add(self, a, b: SuperNumber): out = a for i in range(b): calc_d.multi(calls=["Increment"]) out = self.increment(out)
@calc_d.Function("Increment")
def increment(self, a):
return a+1
def integration_test():
calc_d.instantiate("Calculator")
calc = Calculator()
...
‘’’EDIT: Dear dang and YC Hacker News, I would love to create code blocks using surrounding triple quotes..