[omniORB] [patch] __repr__ for structs, CORBA.Any, CORBA.TypeCode

Luke Deller ldeller at xplantechnology.com
Fri May 28 19:22:33 BST 2004


Hi,

I've found it inconvenient that repr() and str() don't give sensible results 
for various objects obtained from omniORB, so I have implemented a __repr__ 
function for CORBA.Any, CORBA.TypeCode and for CORBA struct objects.  The 
latter involved adding to the output of the python backend of omniidl.

I've tried to make the __repr__ function conform to Python Reference Manual 
which says of the __repr__ return value:

"If at all possible, this should look like a valid Python expression that 
could be used to recreate an object with the same value (given an 
appropriate environment)".

The cvs diff is attached.  Hope it is useful to others also.  Any chance of 
adding this to the official distribution, Duncan?

Regards,
Luke.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: omniORBpy-repr.patch
Type: text/x-patch
Size: 4612 bytes
Desc: not available
Url : http://www.omniorb-support.com/pipermail/omniorb-list/attachments/20040528/30040683/omniORBpy-repr.bin


More information about the omniORB-list mailing list