Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin
Znav
nextPython Mapping for Constants
prevPython Mapping for Sequences

Here is the definition of our EmployeeMap once more:

Wiki Markup
{zcode:slice}
dictionary<long, Employee> EmployeeMap;
{zcode}

As for sequences, the Python mapping does not create a separate named type for this definition. Instead, all dictionaries are simply instances of Python's dictionary type. For example:

Wiki Markup
{zcode:py}
em = {}

e = Employee()
e.number = 31
e.firstName = "James"
e.lastName = "Gosling"

em[e.number] = e
{zcode}

The Ice run time validates the elements of a dictionary to ensure that they are compatible with the declared type; a ValueError exception is raised if an incompatible type is encountered.

Ztop
See Also
Zret
Znav
nextPython Mapping for Constants
prevPython Mapping for Sequences