Message12808

Author jeff.allen
Recipients jeff.allen, zyasoft
Date 2019-11-26.20:37:22
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1574800642.56.0.532563959661.issue2838@roundup.psfhosted.org>
In-reply-to
Content
My preference (and I'm thinking of Jython 3 too) would be that if an object claims as the name of its Python type, the name of a Java type, then it should behave exactly as the Java documentation describes.

It is certainly useful to be able to pass a list returned from a Java method into a Python function and have it treated as a list, but then inside the Python function I think it should behave exactly as a Python list. Otherwise, the result may not be according to the contract of the Python code.

This involves some kind of wrapper that proxies the Java List, and ideally, claims the type 'list'. I'm not sure this is possible in 2.7, but I have an idea to allow multiple implementations of a single Python type. The wrapper could go on:

1. On return from the Java function. (Not keen as we lose Java added value )
2. Implicitly as it becomes a call argument. (Precludes use as Java type in function.)
3. Explicitly with some kind of object.as_list() method. (Other syntax available.)
History
Date User Action Args
2019-11-26 20:37:22jeff.allensetmessageid: <1574800642.56.0.532563959661.issue2838@roundup.psfhosted.org>
2019-11-26 20:37:22jeff.allensetrecipients: + jeff.allen, zyasoft
2019-11-26 20:37:22jeff.allenlinkissue2838 messages
2019-11-26 20:37:22jeff.allencreate