'Construct a variable
MASTER can be given as master widget.
VALUE is an optional value (defaults to "")
NAME is an optional Tcl name (defaults to PY_VARnum).
If NAME matches an existing variable and VALUE is omitted
then the existing value is retained.'

def __init__(self, master=None, value=None, name=None):

    global _varnum
    if (not master):
        master = _default_root
    self._master = master
    self._tk = master.tk
    if name:
        self._name = name
    else:
        self._name = ('PY_VAR' + repr(_varnum))
        _varnum += 1
    if (value is not None):
        self.set(value)
    elif (not self._tk.call('info', 'exists', self._name)):
        self.set(self._default)
