tlm_adjoint.alias

Module Contents

tlm_adjoint.alias.gc_disabled(fn)

Decorator to disable the Python garbage collector.

Parameters:

fn – A callable for which the Python garbage collector should be disabled.

Returns:

A callable for which the Python garbage collector is disabled.

class tlm_adjoint.alias.Alias(obj)

An alias to an object. Holds a reference to the original object.

Parameters:

obj – Object to alias.

class tlm_adjoint.alias.WeakAlias(obj)

An alias to an object. Does not hold a reference to the original object.

Intended to be used in combination with weakref.finalize, so that object attributes may be updated when the original object is destroyed, but object methods may still be called after it is destroyed.

Parameters:

obj – Object to alias.