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


Groups > comp.lang.python > #104082

Re: Any comment on using ctypesgen package?

Newsgroups comp.lang.python
Date 2016-03-04 21:35 -0800
References <3f342ec1-c6cd-49a8-aca2-2eac21fbbd79@googlegroups.com> <mailman.186.1457094947.20602.python-list@python.org>
Message-ID <43488da7-39c7-4291-a219-10e59d4491bd@googlegroups.com> (permalink)
Subject Re: Any comment on using ctypesgen package?
From jfong@ms4.hinet.net

Show all headers | View raw


Peter Otten 2016/3/4  UTC+8 8:36:02PM worte:
> """
> The 2to3 route is not likely to apply since ctypesgen actually writes Python 
> code and the 2to3 utility will probably miss a good portion of that logic.
> """
> 
> But as someone else seems to have done the work already
> 
> https://github.com/davidjamesca/ctypesgen/issues/51
> 
> I'd try his version first.

Following this link, it says "Make output python3-compatible". So it still run under 2.x but generate codes for 3.x:-(

After taking Chris's suggestion, the installation is pushing forward a little and then bump into another error:
----------
File "D:\Patch\ctypesgen-master\ctypesgencore\parser\pplexer.py", line 123, in  
punctuator_regex
    punctuator_regexes.sort(lambda a, b: -cmp(len(a), len(b)))
TypeError: must use keyword argument for key function
----------
This error has been mentioned in "Sorting HOW TO" section in 3.4 document,
    "In Py3.0, the cmp parameter was removed entirely"
    "To convert to a key function, just wrap the old comparison function:"
    "In Python 3.2, the functools.cmp_to_key() function was added to the functools module in the standard library."

Oh, goodness! do I have to dive into 2.x?

Based on the assumptions below:
1. It might be not easy to upgrade it to 3.x (at least not just run 2To3), or else its author will not drop it.
2. I have to go back into 2.x jungle to study all these difference.
3. Even "Python setup.py install" passed, it's still not sure if the output will be correct.

I think it's better to drop it too. Thanks for your advice, Chris and Peter.

--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