|
|
|
|
|
by wdfx
597 days ago
|
|
What's jarring me with the parent's example is the fact that the context managers must be holding global state. It would feel a lot better if it was this, for example, where you use each context explicitly: from diagrams import Diagram
from diagrams.aws.compute import EC2
with Diagram("Simple Diagram") as d:
d.add(EC2("web"))
As as the parent also suggests, this then doesn't really need the context management at all from diagrams import Diagram
from diagrams.aws.compute import EC2
d = Diagram("Simple Diagram")
d.add(EC2("web"))
|
|