[Xapian-tickets] [Xapian] #341: Python bindings should keep a reference to user-subclassable proxies when registered with consumers/users
Xapian
nobody at xapian.org
Wed Mar 4 16:11:12 GMT 2009
#341: Python bindings should keep a reference to user-subclassable proxies when
registered with consumers/users
-----------------------------+----------------------------------------------
Reporter: james | Owner: richard
Type: defect | Status: assigned
Priority: normal | Milestone: 1.1.1
Component: Xapian-bindings | Version: SVN trunk
Severity: normal | Resolution:
Keywords: | Blockedby:
Platform: All | Blocking:
-----------------------------+----------------------------------------------
Comment(by james):
I hadn't tested it, but I have now and in doing so I've noticed a similar
hack being used for TermFreqSource in DocSim (this is from a Richard
branch, I assume; it's not in trunk). I've conformed my code to match that
(which was much better style anyway):
{{{
# When we set a ValueRangeProcessor into the QueryParser, keep a python
# reference so it won't be deleted. This hack can probably be removed once
# xapian bug #186 is fixed.
__queryparser_add_valuerangeprocessor_orig =
QueryParser.add_valuerangeprocessor
def _queryparser_add_valuerangeprocessor(self, vrproc):
self._vrps.append(vrproc)
return __queryparser_add_valuerangeprocessor_orig(self, vrproc)
_queryparser_add_valuerangeprocessor.__doc__ =
__queryparser_add_valuerangeprocessor_orig.__doc__
QueryParser._vrps = []
QueryParser.add_valuerangeprocessor = _queryparser_add_valuerangeprocessor
del _queryparser_add_valuerangeprocessor
}}}
--
Ticket URL: <http://trac.xapian.org/ticket/341#comment:4>
Xapian <http://xapian.org/>
Xapian
More information about the Xapian-tickets
mailing list