Package pyxb :: Package utils :: Module utility :: Class _DeconflictSymbols_mixin |
[hide private]
[frames] | no frames]

# type _DeconflictSymbols_mixin

source code

    object --+
             |
            _DeconflictSymbols_mixin

Known Subclasses:
  - binding.basis.simpleTypeDefinition
  - , binding.basis.complexTypeDefinition
  - , binding.basis.element

Mix-in used to deconflict public symbols in classes that may be inherited by generated binding classes.

Some classes, like the pyxb.binding.basis.element or pyxb.binding.basis.simpleTypeDefinition classes in pyxb.binding.basis, have public symbols associated with functions and variables. It is possible that an XML schema might include tags and attribute names that match these symbols. To avoid conflict, the reserved symbols marked in this class are added to the pre-defined identifier set.

Subclasses should create a class-level variable `_ReservedSymbols` that contains a set of strings denoting the symbols reserved in this class, combined with those from any superclasses that also have reserved symbols. Code like the following is suggested:

      # For base classes (direct mix-in):
      _ReservedSymbols = set([ 'one', 'two' ])
      # For subclasses:
      _ReservedSymbols = SuperClass._ReservedSymbols.union(set([ 'three' ]))

Only public symbols (those with no underscores) are currently supported. (Private symbols can't be deconflicted that easily, and no protected symbols that derive from the XML are created by the binding generator.)

Class Variables | [hide private]
| _ReservedSymbols = ``set([``])`` There are no reserved symbols in the base class.