|
From: <bc...@wo...> - 2001-01-26 11:52:31
|
[Brad Buchsbaum] >On the topic of coercion, currently (correct me if I'm wrong) when a java >numeric primitive (it, double, etc.) is accessed from jython code a >conversion takes place from the native java type to a PyNumber object. Correct. The concrete classes are PyInteger and PyFloat. [Description of jython's coolness snipped] >Is there any way that java primitives could be accessed "as-is" from within >Jython? I'm no expert on language implementation and I'm sure the types-sig have stronger and more well-founded opinions than I, but I don't think we can do it transparently. The tools I have seen described on c.l.py which performed analysis of the control flow and data types suggested that such analysis are dificult for python code both in theory and in practice. I know JimH felt very strongly about this topic (he was very numerical) and he might have been able to add some improvements. I can't. Doing it through some kind of explicit type syntax that is added to the python code is OTOH possible, but I'm not going to spearhead a syntax change to python. When the types-sig have convinced Guido of a design for explicit types, we will ofcourse add it to jython in a way that takes advantage of the possible speed improvements. regards, finn |