Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Chris Angelico Newsgroups: comp.lang.python Subject: Re: Any comment on using ctypesgen package? Date: Sat, 5 Mar 2016 16:49:50 +1100 Lines: 28 Message-ID: References: <3f342ec1-c6cd-49a8-aca2-2eac21fbbd79@googlegroups.com> <43488da7-39c7-4291-a219-10e59d4491bd@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: news.uni-berlin.de fsYbuEI/9FsGAvokHPWUkgw8TQPH2c3djWSZxKdDAkgg== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'error:': 0.05; 'skip:" 60': 0.05; 'correct.': 0.07; 'setup.py': 0.07; 'cc:addr:python- list': 0.09; '"in': 0.09; 'oh,': 0.09; 'subject:using': 0.09; 'typeerror:': 0.09; 'python': 0.10; '(at': 0.13; 'output': 0.13; 'argument': 0.15; '"python': 0.16; '"to': 0.16; '2016': 0.16; '3.2,': 0.16; '4:35': 0.16; 'advice,': 0.16; 'assumptions': 0.16; 'bump': 0.16; 'cmp': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'install"': 0.16; 'length,': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'subject:comment': 0.16; 'wrote:': 0.16; 'cc:2**0': 0.20; 'cc:addr:python.org': 0.20; '2.x': 0.22; '3.x': 0.22; 'function,': 0.22; 'parameter': 0.22; 'trying': 0.22; 'installation': 0.23; 'sat,': 0.23; 'header:In-Reply-To:1': 0.24; 'sort': 0.25; 'module': 0.25; '----------': 0.25; 'chris': 0.26; 'error': 0.27; 'least': 0.27; 'message-id:@mail.gmail.com': 0.27; 'function': 0.28; 'looks': 0.29; 'comparison': 0.29; 'document,': 0.29; 'convert': 0.29; 'too.': 0.30; 'another': 0.32; 'maybe': 0.33; 'run': 0.33; 'wrap': 0.33; 'file': 0.34; 'received:google.com': 0.35; 'skip:p 30': 0.35; 'received:209.85': 0.36; '(and': 0.36; 'keyword': 0.36; 'subject:?': 0.36; 'pm,': 0.36; 'subject:: ': 0.37; 'thanks': 0.37; 'received:209.85.213': 0.37; 'things': 0.38; 'received:209': 0.38; 'drop': 0.38; 'sure': 0.39; 'enough': 0.39; 'easily': 0.39; 'still': 0.40; 'easy': 0.60; 'your': 0.60; 'back': 0.62; 'mar': 0.65; 'here': 0.66; 'forward': 0.66; 'study': 0.70; 'below:': 0.71; '3.4': 0.84; 'chrisa': 0.84; 'difference.': 0.84; 'subject:Any': 0.84; 'suggestion,': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=2Er2JUoUPfvGvF9amaqnma/X8Ohv1oQG+xFnG+9opXA=; b=jB4dKHOV7+B41Rfvj+dRLQLeozvz6odSxH+qYsYnyWimbDIK5Lkmeb2sqlXv3sRL5f hA9GPhAc1rnjZqLptTAbPtUDdeck8r7AHa6DZsuuQLnNI+aRD5rf/11V1w2e2s1N90ZF 0caFQmHN2FgKdxLFSw9EmsWaLLDb8PXB5w7DpOIHB2nyPh/3WspUHlke7An5l9GU4cHw qZKMHm1ML8Ntp8qWzgKlVBa5UAtZqVNS75u+74mUKVrORZxBfBgjGcFRqcbvQXU4EDNj IUb9+9L+Ng/NTZCVLtDdQ4AtF2naM7Y9oi3xJLATwFJLl3ektfNWbrSZ5rFoaMWpiW7X vGXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc; bh=2Er2JUoUPfvGvF9amaqnma/X8Ohv1oQG+xFnG+9opXA=; b=EhYHfkfE+DSpe2CB1/nq9zyIidQYns1P5PPeMNnObe5ATelFeFAEn9Ae1rRqxdivhQ Mx9vB8Ztz6ZLE61MPUUEoKnE4ygsW5V9carCvkK4frNfUiRntO3Npl6U9zhanvTpsn8B 6CwrjfR5OLgOUvta4+t6zL69kwGBmBWBh6YtBrTehcqwtN4cBo4dLlPRHEUYQC00UrgG 3g8ASmO19HU9+Dmz6vDK4ddL9xC6Th89wFGd58RWYkfK/2aAtHakGdhaWA20pdhDdVJp 1Bdt6JpTcL2Y61IJUc7yEKqYjF6hUD8mYvatxP/JMDnGVt0VLvBX3g8P3I+JhK263oOu qE/Q== X-Gm-Message-State: AD7BkJKmSQPBsxQ0d4a2razqrsvVVWHajGl5k/0jDz5q9IfgkKetFLlCKVSRzKoyoQZx4Qo2+ux+kIUlBKUlDA== X-Received: by 10.50.137.35 with SMTP id qf3mr2521570igb.92.1457156990291; Fri, 04 Mar 2016 21:49:50 -0800 (PST) In-Reply-To: <43488da7-39c7-4291-a219-10e59d4491bd@googlegroups.com> X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Xref: csiph.com comp.lang.python:104083 On Sat, Mar 5, 2016 at 4:35 PM, wrote: > 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. 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"). ChrisA