[Xapian-tickets] [Xapian] #297: Python bindings `xapian.cvar` raises strange NameError in unexpected circumstances
Xapian
nobody at xapian.org
Thu Jul 9 07:16:53 BST 2009
#297: Python bindings `xapian.cvar` raises strange NameError in unexpected
circumstances
-----------------------------+----------------------------------------------
Reporter: exarkun | Owner: richard
Type: defect | Status: new
Priority: low | Milestone: 1.2.0
Component: Xapian-bindings | Version: SVN trunk
Severity: normal | Keywords:
Blockedby: | Platform: All
Blocking: |
-----------------------------+----------------------------------------------
Changes (by olly):
* component: Other => Xapian-bindings
* milestone: 1.1.4 => 1.2.0
Comment:
SWIG seems to handle these (at file scope) as variables you can't write
to:
{{{
const int CONST1 = 1;
static const int CONST2 = 2;
}}}
But these (at file scope) are handled as "constants" (Python apparently
doesn't have native constants, but these cases are handled differently in
the SWIG-generated code to how the above cases are):
{{{
#define CONST3 3
enum { CONST4 = 4 };
%constant int CONST5 = 5;
}}}
The SWIG developers seem to agree that the first two should handled the
same as the last three, so I think we just need to wait for a fix, or fix
it there ourselves. I had a quick poke at a workaround using {{{#ifdef
SWIG}}} in xapian/types.h, but the things I tried didn't work (the best I
could achieve was making BAD_VALUENO a constant with value -1).
I don't see this as key to fix in 1.1.x since changing how BAD_VALUENO
gets set up shouldn't affect code using the Python bindings, so bumping to
1.2.x.
--
Ticket URL: <http://trac.xapian.org/ticket/297#comment:6>
Xapian <http://xapian.org/>
Xapian
More information about the Xapian-tickets
mailing list