Re: [Python-Dev] re performance

2017-01-26 Thread MRAB
On 2017-01-26 21:46, Sven R. Kunze wrote: On 26.01.2017 22:33, Vlastimil Brom wrote: Hi, I can't speak about the details of mrab's implementation, but using regex, I get the resulting match instantly: [...] Nice! I focused on the stdlib re module as this is mainly used by other frameworks

Re: [Python-Dev] re performance

2017-01-26 Thread MRAB
On 2017-01-26 21:13, Sven R. Kunze wrote: Hi folks, I recently refreshed regular expressions theoretical basics *indulging in reminiscences* So, I read https://swtch.com/~rsc/regexp/regexp1.html However, reaching the chart in the lower third of the article, I saw Python 2.4 measured against a

Re: [Python-Dev] re performance

2017-01-26 Thread Sven R. Kunze
On 26.01.2017 22:33, Vlastimil Brom wrote: Hi, I can't speak about the details of mrab's implementation, but using regex, I get the resulting match instantly: [...] Nice! I focused on the stdlib re module as this is mainly used by other frameworks (like Django). (I personally prefer to use

Re: [Python-Dev] re performance

2017-01-26 Thread Vlastimil Brom
2017-01-26 22:13 GMT+01:00 Sven R. Kunze : > Hi folks, > > I recently refreshed regular expressions theoretical basics *indulging in > reminiscences* So, I read https://swtch.com/~rsc/regexp/regexp1.html > > However, reaching the chart in the lower third of the article, I saw

[Python-Dev] re performance

2017-01-26 Thread Sven R. Kunze
Hi folks, I recently refreshed regular expressions theoretical basics *indulging in reminiscences* So, I read https://swtch.com/~rsc/regexp/regexp1.html However, reaching the chart in the lower third of the article, I saw Python 2.4 measured against a naive Thompson matching implementation.

Re: [Python-Dev] Why is PyDateTimeAPI not initialized by datetime module import?

2017-01-26 Thread Alexander Belopolsky
On Thu, Jan 26, 2017 at 11:00 AM, Skip Montanaro wrote: > I just got burned (wasted a good day or so) by the fact that PyDateTimeAPI > wasn't initialized. The datetime.rst doc states (emphasis mine): > > Before using any of these functions, the header file

[Python-Dev] Why is PyDateTimeAPI not initialized by datetime module import?

2017-01-26 Thread Skip Montanaro
I just got burned (wasted a good day or so) by the fact that PyDateTimeAPI wasn't initialized. The datetime.rst doc states (emphasis mine): Before using any of these functions, the header file :file:`datetime.h` must be included in your source (note that this is not included by :file:`Python.h`),

Re: [Python-Dev] Generator objects and list comprehensions?

2017-01-26 Thread Ivan Levkivskyi
On 26 January 2017 at 00:53, Nathaniel Smith wrote: > > I'm not sure this is actually a good idea, given the potential for > ambiguity and backwards compatibility considerations -- I'm kind of leaning > towards the deprecate/error option on balance :-). But it's an option that >