From pylucene-dev-return-3079-archive-asf-public=cust-asf.ponee.io@lucene.apache.org Wed Oct 16 21:31:01 2019 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [207.244.88.153]) by mx-eu-01.ponee.io (Postfix) with SMTP id 6CF63180644 for ; Wed, 16 Oct 2019 23:31:01 +0200 (CEST) Received: (qmail 46107 invoked by uid 500); 16 Oct 2019 21:31:00 -0000 Mailing-List: contact pylucene-dev-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: pylucene-dev@lucene.apache.org Delivered-To: mailing list pylucene-dev@lucene.apache.org Received: (qmail 46088 invoked by uid 99); 16 Oct 2019 21:31:00 -0000 Received: from Unknown (HELO mailrelay1-lw-us.apache.org) (10.10.3.42) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 16 Oct 2019 21:31:00 +0000 Received: from [100.73.32.196] (unknown [104.132.11.100]) by mailrelay1-lw-us.apache.org (ASF Mail Server at mailrelay1-lw-us.apache.org) with ESMTPSA id 22D72598D; Wed, 16 Oct 2019 21:31:00 +0000 (UTC) Date: Wed, 16 Oct 2019 14:30:59 -0700 (PDT) From: Andi Vajda X-X-Sender: vajda@yuzu.local Reply-To: Andi Vajda To: Andi Vajda cc: =?ISO-8859-15?Q?Petrus_Hyv=F6nen_=28Jira=29?= , pylucene-dev@lucene.apache.org Subject: Re: [jira] [Commented] (PYLUCENE-51) "AttributeError: __module__" when running doctest In-Reply-To: Message-ID: References: User-Agent: Alpine 2.21 (OSX 202 2017-01-01) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="0-345259974-1571261460=:75776" --0-345259974-1571261460=:75776 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8BIT On Wed, 16 Oct 2019, Andi Vajda wrote: > 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. Or, even simpler, just set in inside installType(). Andi.. --0-345259974-1571261460=:75776--