Skip to content

Allow using a context as parent while keeping it open #31

@gavento

Description

@gavento

I want to repeatedly use a context as a parent context for others, but not close it after the first use.

I want something like this:

c = Context("root", store=store)
with c:
  Context("child1", inputs={"a":42}
[...]
with c:
  Context("child2", inputs={"a":42}
c.close()

This would be especially handy in jupyter notebooks.

One solution would be to have something like:

c = Context("root", store=store)
with c.kept_open:
  Context("child1", inputs={"a":42}
[...]
with c:  # not kept open here
  Context("child2", inputs={"a":42}

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions