Skip to content

unbind API #2478

Closed
Closed
@cgarciae

Description

@cgarciae

As suggested in #2394 (comment), its currently not clear for users that clone produces an unbounded copy of the module. To get hold of a submodule and its variables you currently have to use this pattern:

module, variables = load_module()
bounded_module = module.bind(variables)
submodule = bounded_module.some_submodule.clone()
submodule_variables = bounded_module.variables

The new proposed .unbind() method provide more clarity on how to do this process:

module, variables = load_module()
submodule, submodule_variables = module.bind(variables).some_submodule.unbind()

Signature could be:

unbind(self, **clone_kwargs) -> Tuple[Module, FrozenVariableDict]

cc @jheek

Metadata

Metadata

Assignees

Labels

Priority: P2 - no scheduleBest effort response and resolution. We have no plan to work on this at the moment.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions