The TypeCode interface is defined in the CORBA 2.0 specification [1] and is mapped to Python in the usual manner. Similarly, typecode constants for all of the standard IDL datatypes are defined in the CORBA module. The typecodes for user-defined types are accessed using the method CORBA.typecode(). The CORBA.typecode() method takes a single parameter that is the interface repository identifier of a user-defined type, and returns its corresponding typecode. Instead of writing down the typecode explicitly, it is also possible to use the function CORBA.id().
e.g. Using the enumeration example from section 4.6:
Module Example { enum color {red, green, blue}; };
The typecode for the color enumeration can be accessed and used as follows:
>>> from Fnorb.orb import CORBA >>> import Example >>> tc = CORBA.typecode(`IDL:dstc.edu.au/Example/color:1.0') >>> tc <TypeCode.EnumTypeCode instance at adae0> >>> for i in range(tc.member_count()): ... print tc.member_name(i) ... red green blue >>> tc1 = CORBA.typecode(CORBA.id(Example.color)) >>> tc <TypeCode.EnumTypeCode instance at adae0> >>>