Re: [Python-Dev] Use of Cython
On 2018-08-07, 17:34 GMT, Yury Selivanov wrote: > Speaking of which, Dropbox is working on a new compiler they > call "mypyc". How does it compare with Nuitka? Matěj -- https://matej.ceplovi.cz/blog/, Jabber: mc...@ceplovi.cz GPG Finger: 3C76 A027 CA45 AD70 98B5 BC1D 7920 5802 880B C9D8 If in desperation, read the documentation! -- Brian D. Ripley, on R-help list ___ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
Re: [Python-Dev] Use of Cython
On 2018-08-06, 15:13 GMT, Stefan Behnel wrote: > Not sure I understand this correctly, but I think we're on the > same page here: writing test code in C is cumbersome, writing > test code in a mix of C and Python across different files is > aweful. And making it difficult to write or even just review > test code simply means that people will either waste their > precious contribution time on it, or try to get around it. I was thinking about the same when porting M2Crypto to py3k (M2Crypto is currently swig-based mix of C-code and Python). Is it even possible to make a mix of Cython, swig-based C, and Python? In the end I rather stayed with plain C, because the combination seems unimaginably awful. (Also, is Cython the best of all of them? What about cffi or Nuitka?) Best, Matěj -- https://matej.ceplovi.cz/blog/, Jabber: mc...@ceplovi.cz GPG Finger: 3C76 A027 CA45 AD70 98B5 BC1D 7920 5802 880B C9D8 There is no reason to suppose that most human beings are engaged in maximizing anything unless it be unhappiness, and even this with incomplete success. -- Ronald Coase Introduction to “The Firm, the Market, and the Law” ___ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
Re: [Python-Dev] Use of Cython
On Wed, 08 Aug 2018 12:44:50 +0200 Matěj Cepl wrote: > On 2018-08-06, 15:13 GMT, Stefan Behnel wrote: > > Not sure I understand this correctly, but I think we're on the > > same page here: writing test code in C is cumbersome, writing > > test code in a mix of C and Python across different files is > > aweful. And making it difficult to write or even just review > > test code simply means that people will either waste their > > precious contribution time on it, or try to get around it. > > I was thinking about the same when porting M2Crypto to py3k > (M2Crypto is currently swig-based mix of C-code and Python). Is > it even possible to make a mix of Cython, swig-based C, and > Python? In the end I rather stayed with plain C, because the > combination seems unimaginably awful. I'm not sure why anyone would want to use swig nowadays. > (Also, is Cython the best of all of them? What about cffi or > Nuitka?) This sounds like comparing apples to oranges. Regards Antoine. ___ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
[Python-Dev] AIX and python tests
Try again on this. a) Victor has said he will look, from time to time - after his vacation. b) our vacations do not overlap c) comment was also made privately, re: my starting a worker for buildbot, that there is not much sense in a bot if noone is working on the tests. I'll do my best, in the (limited) time I have to work on c) - but alone I cannot get anything done. So, Victor suggested I just ask for others to review for now - so I can have some semblance of moving forward - before my vacation starts (about when Victor gets back from his). In advance - many thanks. On 8/5/2018 10:59 PM, Michael wrote: > > As I have time, I'll dig into these. > > I have a couple of PR already 'out there', which I hope someone will > be looking at when/as he/she/they have time. My time will also be > intermittent. > > My next test - and I hope not too difficult - would be the test_utf8. > The test: > > FAIL: test_cmd_line (test.test_utf8_mode.UTF8ModeTests) fails - and I > am wondering if it is as simple as AIX default mode is ISO8559-1 and > the test looks to be comparing UTF8 with the locale_default. If that > is the case, obviously this test will never succeed - asis. Am I > understanding the test properly. If yes, then I'll see what I can come > up with for a patch to the test for AIX. If no, I'll need some hand > holding to help me understand the test A bigger challenge, and I think > a major issue with many of the test failures is test_ssl. Here I > already know I'll need so assistance. I am quite lost. I know AIX at > an expert level, but I do not know python (especially python > internals, macros, etc..) and after about 3 levels I am lost. I also > find it hard to get 'artifacts' from the tests to know what is > expected. Looking forward to assistance from various people - in > understanding the tests, and probably better python coding criticism. > Michael > > > ___ > Python-Dev mailing list > Python-Dev@python.org > https://mail.python.org/mailman/listinfo/python-dev > Unsubscribe: > https://mail.python.org/mailman/options/python-dev/aixtools%40felt.demon.nl pEpkey.asc Description: application/pgp-keys ___ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
Re: [Python-Dev] Use of Cython
On 2018-08-08, 11:30 GMT, Antoine Pitrou wrote: > I'm not sure why anyone would want to use swig nowadays. Legacy reasons, 47k lines of Python code (and 7k lines of swig *.i files). Matěj -- https://matej.ceplovi.cz/blog/, Jabber: mc...@ceplovi.cz GPG Finger: 3C76 A027 CA45 AD70 98B5 BC1D 7920 5802 880B C9D8 Do not long for the night, when people vanish in their place. Be careful, do not turn to evil; for you have preferred this to affliction. -- Job 36:20f (NASB) ___ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
Re: [Python-Dev] Refactor __get_builtin_constructor on hasklib.py
Dear Sanyam,Mariatta and Steve, Thanks for your feedback. I will read https://devguide.python.org/ carefully. Best regards, Park Tsai 2018-08-08 2:04 GMT+08:00 Steve Holden : > Hi there, > > Good to see you on python-dev. It's always good to see people getting > excited about helping with Python's development. > > The changes you suggest are, unless I've missed something, purely cosmetic > - affecting readability only. This implies that you feel the code as it > stands isn't as readable as it could be. You must admit that "it looks > messy" is a matter of opinion, and alone isn't much of a justification for > making changes to a project that will reach its end of life in less than > eighteen months. > > The code in the standard library is mostly fairly well-scrutinised, and as > PEP 8 reminds us, change made for purely stylistic reasons threatens to > introduce new bugs. > > It's not obvious how much of the developer documentation you've seen, so > it might be worth mentioning https://devguide.python.org/ as a good > starting point for anyone wanting to contribute. > > regards > Steve > > Steve Holden > > On Tue, Aug 7, 2018 at 8:00 AM, 蔡銘峯 wrote: > >> Hello everybody, >> I am Park Tsai. I want to refactor __get_builtin_constructor on >> hasklib.py of python 2.7 (https://github.com/python/cpy >> thon/blob/2.7/Lib/hashlib.py#L72). >> This is the first time that I try to refactor code of CPython on GitHub, >> so I am very excited. >> >> This is __get_builtin_constructor code on hasklib.py ,as follows. >> >> def __get_builtin_constructor(name): >> try: >> if name in ('SHA1', 'sha1'): >> import _sha >> return _sha.new >> elif name in ('MD5', 'md5'): >> import _md5 >> return _md5.new >> elif name in ('SHA256', 'sha256', 'SHA224', 'sha224'): >> import _sha256 >> bs = name[3:] >> if bs == '256': >> return _sha256.sha256 >> elif bs == '224': >> return _sha256.sha224 >> elif name in ('SHA512', 'sha512', 'SHA384', 'sha384'): >> import _sha512 >> bs = name[3:] >> if bs == '512': >> return _sha512.sha512 >> elif bs == '384': >> return _sha512.sha384 >> except ImportError: >> pass # no extension module, this hash is unsupported. >> >> raise ValueError('unsupported hash type ' + name) >> >> >> When I read this code, it looks messy, so I want to refactor it and make >> it become more clearly . >> >> Then, it will be like this >> >> def get_builtin_constructor(name): >> try: >> if name[:3] in ('SHA','sha'): >>if(name[3:]=='1'): >>import _sha >>return _sha.new >> >>elif (name[3:] == '224'): >>import _sha256 >>return _sha256.sha224 >> >>elif (name[3:] == '256'): >>import _sha256 >>return _sha256.sha256 >> >>elif (name[3:] == '384'): >>import _sha512 >>return _sha512.sha384 >> >>elif (name[3:] == '512'): >>import _sha512 >>return _sha512.sha512 >> elif name in ('MD5', 'md5'): >> import _md5 >> return _md5.new >> >> except ImportError: >> pass # no extension module, this hash is unsupported. >> >> raise ValueError('unsupported hash type ' + name) >> >> I will be grateful for any help you can provide. I really appreciate any >> feedback you can offer! >> >> Best regards, >> Park Tsai !! >> >> ___ >> Python-Dev mailing list >> Python-Dev@python.org >> https://mail.python.org/mailman/listinfo/python-dev >> Unsubscribe: https://mail.python.org/mailman/options/python-dev/steve% >> 40holdenweb.com >> >> > ___ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com