[omniORB] Generated Python types
Duncan Grisby
dgrisby@uk.research.att.com
Tue, 03 Apr 2001 11:44:41 +0100
On Thursday 29 March, Kevin Bailey wrote:
> I just started using omniORBpy and right off it's obvious that
> something's missing - the ability to print out and compare
> omniidl generated types e.g. a __repr__ method.
>
> Is there a flag for generating these methods ? If not, does
> anyone have any tips for doing this ? Hand-editting the
> generated Python or stand-alone functions ?
There isn't currently a flag to generate __repr__ functions. I'll
consider adding it to the next major update.
If you want to add your own, I'd advise against modifying the
generated code -- if you do that, you have to be very careful never to
regenerate the stubs. I'd use stand-alone functions in another
module. If you really want to add a __repr__ function, you can play
nasty games with class dictionaries to assign one class' __repr__
function to another one.
Cheers,
Duncan.
--
-- Duncan Grisby \ Research Engineer --
-- AT&T Laboratories Cambridge --
-- http://www.uk.research.att.com/~dpg1 --