From: Diez B. R. <de...@we...> - 2007-01-20 10:26:01
|
> 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? Why do you single out generics? There is no type annotation support in jython _anywhere_, it is the very reason I prefer jython over java in most cases. So why should anybody expect foo = "bar" foo = 100 to work, while map.put("foo", 100) map.put(100, "foo") expect to puke with type errors? So I'd say no, there is no need to especially document that. Diez |