Skip to content

ReferencableVariable

Dmitry Starov edited this page Jun 25, 2020 · 1 revision

Русская версия


ReferencableVariable class

This class allows you to operate variables as well, as you pass them by a pointer.

Usage:

>>> a = ReferencableVariable(4)
>>> a.get()
4
>>> b = a
>>> b.set(128)
>>> a.get()
128
>>> c = b
>>> c.set(64)
>>> a.get()
64

Constructor

class common.ReferencableVariable(value)

Parameters:

  • value : A value to be stored

Methods

ReferencableVariable.get()

An accessor to get the stored value.

ReferencableVariable.set(value)

An accessor to set the stored value with the value.

Properties

ReferencableVariable.value

A value property is used as an accessor to get and to set the stored value.

Usage:

>>> refvar.value = 4
>>> refvar.value
4
>>> refvar.value = 8
>>> refvar.value
8

Clone this wiki locally