[Xapian-tickets] [Xapian] #346: Python 3 support
Xapian
nobody at xapian.org
Thu Sep 26 00:31:08 BST 2013
#346: Python 3 support
--------------------------------------+------------------------------
Reporter: olly | Owner: richard
Type: defect | Status: assigned
Priority: highest | Milestone: 1.3.2
Component: Xapian-bindings (Python) | Version: SVN trunk
Severity: normal | Resolution:
Keywords: | Blocked By:
Blocking: | Operating System: All
--------------------------------------+------------------------------
\
\
\
\
\
\
Comment (by olly):
Richard's description in comment:59 is pretty much identical to what I'm
currently thinking, except that get_description() (as renamed to __str__)
needs to return a Unicode string because that's what Python requires (in
comment:48 barry said: ''"In Python 3 you cannot return a bytes object
from str()"'').
We should probably reject str passed to unserialise() methods as well as
sortable_unserialise(), especially as SWIG can apply a typemap to all
methods with the same name in one go.
So it seems like we're converging on a solution!
ISTR we considered a magic return value along those lines before and
rejected it, but I think it was trying to be cleverer in some way -
barry's suggestion seems worth experimenting with I think. It seems
cleaner than having both "get_termname()" and "get_termname_str()"
So a plan - let's implement what's described in the first two paragraphs
of this comment, which will give us a workable Python3 API, and we can try
converting some Python 2 code to see what it feels like, and compare with
how it would be if we returned the BS class. The work to implement the BS
class approach would be on top of the work required for the simpler
approach anyway.
\
\
\
--
Ticket URL: <http://trac.xapian.org/ticket/346#comment:62>
Xapian <http://xapian.org/>
Xapian
More information about the Xapian-tickets
mailing list