Re: Help me cythonize a python routine!

2016-11-10 Thread BartC
On 09/11/2016 21:25, breamore...@gmail.com wrote: On Wednesday, November 9, 2016 at 7:34:41 PM UTC, BartC wrote: However according to your mindset nothing matters provided it's fast, > accuracy does not matter to users. Hence your recent comment on another thread about converting invalid in

Re: Help me cythonize a python routine!

2016-11-09 Thread Steven D'Aprano
On Thursday 10 November 2016 18:23, Andrea D'Amore wrote: > On 10 November 2016 at 00:15, Steve D'Aprano > wrote: >> py> import collections > […] >> py> import os >> py> os.listdir('/usr/local/lib/python3.5/collections/') > > Not > > os.listdir(collections.__path__[0]) > > since it's alrea

Re: Help me cythonize a python routine!

2016-11-09 Thread Andrea D'Amore
On 10 November 2016 at 00:15, Steve D'Aprano wrote: > py> import collections […] > py> import os > py> os.listdir('/usr/local/lib/python3.5/collections/') Not os.listdir(collections.__path__[0]) since it's already there? -- Andrea -- https://mail.python.org/mailman/listinfo/python-list

Re: Help me cythonize a python routine!

2016-11-09 Thread Ethan Furman
On 11/09/2016 04:30 PM, Michael Torrie wrote: On 11/09/2016 04:21 PM, Ethan Furman wrote: On 09/11/2016 21:25, breamore...@gmail.com wrote: [...filtered...] Mark, you do not need to be insulting nor condescending. Agreed. Is he still being filtered on the mailing list? He's still in my ki

Re: Help me cythonize a python routine!

2016-11-09 Thread Michael Torrie
On 11/09/2016 04:21 PM, Ethan Furman wrote: >> On 09/11/2016 21:25, breamore...@gmail.com wrote: > > [...filtered...] > > Mark, you do not need to be insulting nor condescending. Agreed. Is he still being filtered on the mailing list? He's still in my killfile. -- https://mail.python.org/mail

Re: Help me cythonize a python routine!

2016-11-09 Thread Ethan Furman
On 09/11/2016 21:25, breamore...@gmail.com wrote: [...filtered...] Mark, you do not need to be insulting nor condescending. -- ~Ethan~ -- https://mail.python.org/mailman/listinfo/python-list

Re: Help me cythonize a python routine!

2016-11-09 Thread Steve D'Aprano
On Thu, 10 Nov 2016 10:01 am, BartC wrote: > I haven't ruled out that collections is written in Python. But I can't > find a 'collections.py' module in my Python 3.4; the nearest is > "__init__.py". And there /is/ a lot of code there. And that's exactly right. py> import collections py> collecti

Re: Help me cythonize a python routine!

2016-11-09 Thread BartC
On 09/11/2016 21:25, breamore...@gmail.com wrote: On Wednesday, November 9, 2016 at 7:34:41 PM UTC, BartC wrote: All the real work is done inside the Collections module. If that was written in Python, then you'd have to Cythonise that, and there might be quite a lot of it! But I think 'collec

Re: Help me cythonize a python routine!

2016-11-09 Thread BartC
On 05/11/2016 04:11, DFS wrote: It reads in a text file of the Bible, and counts the Top 20 most common words. http://www.truth.info/download/bible.htm import time; start=time.clock() import sys, string from collections import Counter #read fil