A Reference is a name binding. It binds a name, such as foo to an object. References are manually created by the user as attributes of UserSpace:

>>> = 1

When a Reference is created as an attribute of a UserSpace, the name becomes available in the namespace associated with the UserSpace. The Formulas of child Cells of the UserSpace are evaluated in the namespace, so the name that appears in the Formulas refers to the object that the name is bound to by the Reference. Continuing with the above example, suppose a Cells baz is defiened in the same Space space as foo:

>>> space.baz.formula
def baz():
    return foo

The foo in the baz definition referes to 1:

>>> space.baz()

References can also be created as attributes of Model objects. Such References become accessible from any Space in the Model. Suppose model is a Model object and the parent of space:

>>> = "bar"

bar defined above is also defined in space:


And bar can be referred to from the Formulas of child Cells of model:

>>> def baz():
...     return bar

>>> space.baz = baz

>>> space.baz.formula
def baz():
    return bar

>>> space.baz()

Reference objects themselves are hidden from the user, and the bound objects are always referenced by the names. To access the attributes of Reference objects, ReferenceProxy objects are used.


class ReferenceProxy(impl)[source]

Proxy to interface to References

Reference objects are not exposed to the user, thus ReferenceProxy objects are used to interface to References. A proxy object to a Reference can be created and returned by the get_object() function, by passing the full dotted name of the Reference to name, and True to as_proxy:

>>> mx.get_object("", as_proxy=True)

Reference shares its ultimate base class with Model, Space and Cells classes, and below are attributes common among those classes.


The name of the Reference.




The dotted name of the object.




The parent of the Reference.


The Model that the Reference belongs to.



Returns referenced object


Returns reference mode