[Orbit-python-list] Re: [omniORB] Re: Promoting from integer to double in a union?
Status: Inactive
Brought to you by:
tack
From: Duncan G. <dg...@uk...> - 2000-03-20 15:46:08
|
On Monday 20 March, Jason Tackaberry wrote: > > I didn't really expect this to work, but it does with Fnorb and > > omniORB. On the other hand, with orbit-python I get an exception: > > > > CORBA.SystemException: IDL:omg.org/CORBA/BAD_PARAM:1.0: > > Expected float, got int > > I was debating about whether or not I should promote ints to floats. For > consistency and readability, I decided to require a float value. Also, > the Python Language Mapping Specification doesn't explicitely permit > integers here (I think). This sort of discussion comparing Python ORBs would be better off in do...@py.... An earlier version of the Python mapping did specify that compatible types should be promoted. The current version has removed that requirement. I think it is best to avoid promoting types in most cases, and omniORBpy is reasonably strict. The only three promotions it does are integers to floats, integers to doubles, and integers to long integers, for the pragmatic reason that people often use integers in those cases. The mapping spec should perhaps be tightened up to either explicitly permit or forbid such things. Cheers, Duncan. -- -- Duncan Grisby \ Research Engineer -- -- AT&T Laboratories Cambridge -- -- http://www.uk.research.att.com/~dpg1 -- |