lucene-pylucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andi Vajda <va...@apache.org>
Subject Re: [jira] [Commented] (PYLUCENE-51) "AttributeError: __module__" when running doctest
Date Wed, 16 Oct 2019 21:10:10 GMT

On Wed, 16 Oct 2019, Petrus Hyvönen (Jira) wrote:

> Looks like the name in a PyTypeObject tp_name should be of form 
> "module.name", and module is automagically assigned to __module__. I think 
> this is done for some of the special classes but not for the wrapped 
> classes if I understand correctly. I tried to add a "jcc." in front of the 
> name and it seems to propagate to the __module__ parameter. However this 
> should preferably be the wrapped module path instead of just "jcc", is 
> there a good way to extract this path? One way could be to have a new 
> parameter, module to the DEFINE_TYPE but that would require a bit of 
> changes all around.

In other words, instead of generating
  DEFINE_TYPE(SpanFirstBuilder, t_SpanFirstBuilder, SpanFirstBuilder);
JCC should generate something like
  DEFINE_TYPE(org.apache.lucene.queryparser.xml.SpanFirstBuilder,
              t_SpanFirstBuilder, SpanFirstBuilder);

That should simple enough to fix...
Let me give it a quick try.

Andi..
Mime
  • Unnamed multipart/mixed (inline, None, 0 bytes)
View raw message