From: Brian Z. <bz...@ig...> - 2001-03-27 21:04:55
|
Robert, Check out this bug, it might offer a useful description: http://sourceforge.net/tracker/index.php?func=3Ddetail&aid=3D222789&group= _id =3D12867&atid=3D112867 brian -----Original Message----- From: jyt...@li... [mailto:jyt...@li...]On Behalf Of Robert W. Bill Sent: Tuesday, March 27, 2001 2:37 PM To: jyt...@li... Subject: [Jython-users] String Object id question Hi all, I've ran into a bit of confusion with the id() of characters in Jython compared with Python. Here's something similar to the code that started the confusion: ---------------------------------------------------------- S =3D "abc" L =3D ["a", "b", "c"] LoL =3D [L, L, L] stringtest =3D S[1] listtest =3D L[1] loltest =3D LoL[1] def test(obj1, obj2): if ( id(obj1) !=3D id(obj2) ): return 0 assert(test(loltest, LoL[1])), "List-of-lists test failed" assert(test(listtest, L[1])), "List test failed" assert(test(stringtest, S[1])), "String test failed" ---------------------------------------------------------- In CPython, all passes, but in Jython, there's always an AE: String test failed. Is this expected? unavoidable? Tnx -Robert _______________________________________________ Jython-users mailing list Jyt...@li... http://lists.sourceforge.net/lists/listinfo/jython-users |