Issue 4316: Problem with Python Language Mapping (python-ftf) Source: BBN Technologies (Mr. Craig Rodrigues, crodrigu@bbn.com) Nature: Uncategorized Issue Severity: Summary: I'd like to point out some errors in the Python Language Mapping document, ftp://ftp.omg.org/pub/docs/formal/01-02-66.pdf, section 1.3.9 "Mapping for an Any". The example which accompanies the text for this section is vague, contains errors, and is confusing to someone who is trying to learn how to use Anys in the Python Language Mapping. For discussion of some of the errors in this example, refer to the following messages on the omniORB mailing list: http://www.uk.research.att.com/omniORB/archives/2001-04/0139.html http://www.uk.research.att.com/omniORB/archives/2001-04/0140.html I believe the example is broken in many ways, and should be re-written to more clearly illustrate how to use Anys with the Python Language Mapping. I have re-written the example as follows: ======================================================================== import CORBA import M # Create a value of type M.S v = M.S(1, CORBA.TRUE) # obtain type code tc=CORBA.TypeCode( CORBA.id(M.S) ) # could also use: tc1=CORBA.TypeCode("IDL:M/S:1.0") # Create any containing an M.S object any1 = CORBA.Any(tc, v) ## the TypeCodes for the basic CORBA types are defined ## in the CORBA 2.4 standard, section 10.7.2 "TypeCode Constants" # Create any containing CORBA Long any2 = CORBA.Any(CORBA.TC_long, 1) # Create any containing CORBA Float any3 = CORBA.Any(CORBA.TC_float, 3.14) # Create any containing CORBA Float any4 = CORBA.Any(CORBA.TC_short, 5) # Create any containing CORBA unsigned any5 = CORBA.Any(CORBA.TC_ushort, 6) # Create any containing CORBA String any6 = CORBA.Any(CORBA.TC_string, "some string") o = something() # somehow obtain reference to object of type M.foo o.operate( any1 ) o.operate( any2 ) o.operate( any3 ) . . . ======================================================================== I believe that it is imperative that this example be changed in Section 1.3.9 of the Python Language Mapping. Resolution: Duplicate of issue # 4315 Revised Text: Actions taken: Discussion: End of Annotations:===== X-Authentication-Warning: emerald.omg.org: hobbit.omg.org [192.67.184.3] didn't use HELO protocol Received: from crodrigues.bbn.com (128.89.13.35) by hobbit.omg.org asmtp(1.0) id 9491; Sun, 20 May 2001 03:44:26 -0400 (EDT) Received: (from crodrigu@localhost) by crodrigues.bbn.com (8.9.3/8.9.3) id DAA25422; Sun, 20 May 2001 03:39:24 -0400 Date: Sun, 20 May 2001 03:39:24 -0400 From: Craig Rodrigues To: issues@omg.org Cc: python-ftf@omg.org, Craig Rodrigues Subject: Problem with Python Language Mapping Message-ID: <20010520033924.A25407@bbn.com> Mime-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.2.4i Content-Type: text/plain; charset=us-ascii X-UIDL: H From: Martin von Loewis To: python-rtf@omg.org Subject: Vote 3 Tally Content-Type: text X-UIDL: oEo!!\W"e9U?#!!XkW!! The issues of Vote 3 where resolved as follows Issue 4315: YES (in favour: AT&T, BBN(*), HUB; opposed: 0, abstain: 0) Issue 4658: YES (in favour: AT&T, BBN, HUB; opposed: 0, abstain: 0) Issue 4659: YES (in favour: AT&T, BBN, HUB; opposed: 0, abstain: 0) Issue 4660: YES (in favour: AT&T, BBN, HUB; opposed: 0, abstain: 0) Issue 4661: YES (in favour: AT&T, BBN, HUB; opposed: 0, abstain: 0) (*) With friendly amendment Issue 4315: Change the following text: "# Create any containing CORBA Float any4 = CORBA.Any(CORBA.TC_short, 5) # Create any containing CORBA unsigned any5 = CORBA.Any(CORBA.TC_ushort, 6)" to: # Create any containing CORBA short any4 = CORBA.Any(CORBA.TC_short, 5) # Create any containing CORBA unsigned short any5 = CORBA.Any(CORBA.TC_ushort, 6) Regards, Martin