Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #104087

Re: Any comment on using ctypesgen package?

X-Received by 10.140.156.139 with SMTP id c133mr8726473qhc.4.1457165668518; Sat, 05 Mar 2016 00:14:28 -0800 (PST)
X-Received by 10.50.111.100 with SMTP id ih4mr64872igb.3.1457165668475; Sat, 05 Mar 2016 00:14:28 -0800 (PST)
Path csiph.com!usenet.blueworldhosting.com!feeder01.blueworldhosting.com!peer02.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!y89no5622242qge.0!news-out.google.com!k1ni9229igd.0!nntp.google.com!hb3no11519179igb.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail
Newsgroups comp.lang.python
Date Sat, 5 Mar 2016 00:14:28 -0800 (PST)
In-Reply-To <mailman.219.1457156993.20602.python-list@python.org>
Complaints-To groups-abuse@google.com
Injection-Info glegroupsg2000goo.googlegroups.com; posting-host=36.238.106.217; posting-account=G2sM6AoAAADOlDdo9rWD6sFkj3T5ULsz
NNTP-Posting-Host 36.238.106.217
References <3f342ec1-c6cd-49a8-aca2-2eac21fbbd79@googlegroups.com> <mailman.186.1457094947.20602.python-list@python.org> <43488da7-39c7-4291-a219-10e59d4491bd@googlegroups.com> <mailman.219.1457156993.20602.python-list@python.org>
User-Agent G2/1.0
MIME-Version 1.0
Message-ID <366bbd75-21fa-4332-b5dd-49557dc238e1@googlegroups.com> (permalink)
Subject Re: Any comment on using ctypesgen package?
From jfong@ms4.hinet.net
Injection-Date Sat, 05 Mar 2016 08:14:28 +0000
Content-Type text/plain; charset=ISO-8859-1
Content-Transfer-Encoding quoted-printable
X-Received-Bytes 3413
X-Received-Body-CRC 476815517
Xref csiph.com comp.lang.python:104087

Show key headers only | View raw


Chris Angelico at 2016/3/5  UTC+8 1:50:05PM wrote:
> Your conclusion may well be correct. However, the exact issue you're
> looking at here might be easily enough fixed; it looks like it's
> trying to sort things by length, so you can simply use "key=len" (and
> maybe "reverse=True").

After Chris gave this suggestion, I can't withstand the temptation of running the setup again. This time, strangely, it reports error on import. Won't the import statement easy enough to be handled by 2To3? Here is the result (where the whole "ctypesgencore" directory had been processed by 2To3 and the "parser" is a sub-directory under it):

----------
D:\Patch\ctypesgen-master>python setup.py install
Traceback (most recent call last):
  File "setup.py", line 13, in <module>
    import ctypesgencore
  File "D:\Patch\ctypesgen-master\ctypesgencore\__init__.py", line 55, in <modul
e>
    from . import parser
  File "D:\Patch\ctypesgen-master\ctypesgencore\parser\__init__.py", line 17, in
 <module>
    from .datacollectingparser import DataCollectingParser
  File "D:\Patch\ctypesgen-master\ctypesgencore\parser\datacollectingparser.py",
 line 10, in <module>
    from . import ctypesparser
  File "D:\Patch\ctypesgen-master\ctypesgencore\parser\ctypesparser.py", line 15
, in <module>
    from .cparser import *
  File "D:\Patch\ctypesgen-master\ctypesgencore\parser\cparser.py", line 21, in
<module>
    from . import cgrammar
  File "D:\Patch\ctypesgen-master\ctypesgencore\parser\cgrammar.py", line 25, in
 <module>
    from . import ctypesparser
ImportError: cannot import name 'ctypesparser'
------------

Just curious, is there a recursive-import happen on handling the "parser" directory?

After checking the files, I had noticed that all the import statements had been changed by 2To3. Mostly the changes are, such as, from "import cgrammar" to "from . import cgrammar", or "from cparser import *" to "from .cparset import *". I can understand the former, but can't figure out the latter:-(

--Jach

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Any comment on using ctypesgen package? jfong@ms4.hinet.net - 2016-03-04 03:08 -0800
  Re: Any comment on using ctypesgen package? Chris Angelico <rosuav@gmail.com> - 2016-03-04 23:00 +1100
  Re: Any comment on using ctypesgen package? Peter Otten <__peter__@web.de> - 2016-03-04 13:35 +0100
    Re: Any comment on using ctypesgen package? jfong@ms4.hinet.net - 2016-03-04 21:35 -0800
      Re: Any comment on using ctypesgen package? Chris Angelico <rosuav@gmail.com> - 2016-03-05 16:49 +1100
        Re: Any comment on using ctypesgen package? jfong@ms4.hinet.net - 2016-03-05 00:14 -0800
          Re: Any comment on using ctypesgen package? Mark Lawrence <breamoreboy@yahoo.co.uk> - 2016-03-05 11:59 +0000
            Re: Any comment on using ctypesgen package? jfong@ms4.hinet.net - 2016-03-06 16:57 -0800

csiph-web