On Thursday 09 March 2017, Andi Vajda wrote:

Thank you for your contribution. I have not looked at it yet
but
you're now the second contributor with python3 support.

Ah this one was hard to find. It looks very similar to my one and has some nice build fixes which I imported too. Otherwise my fork is addressing already some more issues now.

The one thing
I suspect is missing is proper python 3.x (x > 3 ?) <-> java string
conversions. In these versions of python the internal string
representation was changed to be more clever about how many bytes to
use per unicode char based on the data of the string. One would want
to take advantage of that to minimize conversions between both
languages.

Support for earlier versions of python 3 is irrelevant and
not necessary.

So maybe you could derive benefit from my mentioned py2 branch which carefully removes already python < 2.7 support and solves all the trivial but labour-intensive tasks towards python3.

You can take a look at the PyICU sources (github) for
the kinds of conversion functions I'm referring to. (function
PyUnicode_FromUnicodeString and reverse in common.cpp:
https://github.com/ovalhub/pyicu/blob/master/common.cpp)

Thanks, I will have a look at it.

Actually I have now all test-suite problems fixed, most of the failures were cause by python3 incompatibilities in the pylucene itself.

BUT some more interesting questions arised ... about the jcc interface. Speaking in examples:

1.
Should JArray('byte')("x") still work in python3 or should we require JArray('byte')(b"x")? Currently JArray('byte')(U"x") is not supported.

2.
Currently JArray_byte.string_() returns class str on python2 which are "bytes". Should we keep it that way? The original old python3 port added a new bytes_() method to get "bytes" and changed string_() to return unicode. This looks reasonable but incompatible for the users. We could instead keep the string_() function as is and add a new unicode_() instead.

I've implemented both alternatives already for 1. and 2. Just need a decision what is the way we want to go.

cu,
Rudi




Reply via email to