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


Groups > comp.lang.python > #104087

Re: Any comment on using ctypesgen package?

Newsgroups comp.lang.python
Date 2016-03-05 00:14 -0800
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>
Message-ID <366bbd75-21fa-4332-b5dd-49557dc238e1@googlegroups.com> (permalink)
Subject Re: Any comment on using ctypesgen package?
From jfong@ms4.hinet.net

Show all headers | 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