From: Leo U. <leo...@ya...> - 2007-01-19 18:48:58
|
yup, your right about Java's generics not existing at runtime. If java objects were naked in jython we could probably do some quick cast checks in the generated code, but alas they are not. Outside of that checking could always be put in the layer surrounding the collection class, but I don't think it would be a cheap thing to do. Every add would probably require a native method check. On the other hand, in developing the proxy method code Ive got a way around using this native method check so it conceivably use the same thing. leouser p.s. there is talk about changing generics in java for 7... --- Alexander Stoddard <ast...@ma...> wrote: > Generally should questions or comments about jython > documentation be > sent to the users list, dev list or submitted to > sourceforge as bugs > or feature requests? > > I have two specific things regarding additions to > the documentation > and I will mention them here for now. > > 1) Java Collections Integration. > I encountered jython when this was a hot topic on > the lists and the > implementation was becoming complete. I think > someone coming to > jython now might remain ignorant of it. > > Of course it is absent from the canonical "Jython > essentials" and > "Jython for Java Developers" as it is part of Jython > 2.2. When I > checked the web site I failed to find any mention of > this feature. It > is really not written up on the current web site or > am I missing it? > > 2) Jython (non)interaction with java generics > Jython completely ignores java generics. In my > opinion this is > trivial but non-obvious. It is trivial once I > remember that java > generics have no support in the JVM and are > essentially compile time > magic (please correct me if i am wrong on this). It > is non-obvious > because I don't normally think about such things > when just using > code. I wouldn't have seen this behavior without > deliberately setting > out to test it. > > Generics provide no type safety to jython scripting > on java > collections. I suspect this could be the source of > nasty bugs for the > unwary. Is this issue worthy of documenting? > > Thank you, > Alex Stoddard > > > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get > the chance to share your > opinions on IT & business topics through brief > surveys - and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ > Jython-users mailing list > Jyt...@li... > https://lists.sourceforge.net/lists/listinfo/jython-users > ____________________________________________________________________________________ Now that's room service! Choose from over 150,000 hotels in 45,000 destinations on Yahoo! Travel to find your fit. http://farechase.yahoo.com/promo-generic-14795097 |