A new coding style: use regex instead of g.skip functions

2016-11-11 Thread Edward K. Ream
Leo's g.skip_ functions are a relic of my C coding days. They are usually slow and clumsy compared to regex patterns. The new importer uses regex's almost everywhere, including all clean_headline methods, and wherever the code needs to determine whether a line starts a class or def. An

Re: A new pattern for me: `s.isspace()` instead of `not s.strip()`

2016-11-11 Thread 'Terry Brown' via leo-editor
On Fri, 11 Nov 2016 08:12:57 -0800 (PST) "Edward K. Ream" wrote: > On Thursday, November 10, 2016 at 12:48:28 PM UTC-6, Edward K. Ream > wrote: > > > > Up until today, I have always tested for an empty string using not > > s.strip(). But Doh, this is an unnecessary stress

Re: Status report: the new importers are nearing completion

2016-11-11 Thread Edward K. Ream
On Friday, November 11, 2016 at 10:27:38 AM UTC-6, Edward K. Ream wrote: Work is going extremely well. > I forget to mention the biggest eventual payoff, namely that the old importers will disappear completely. Future maintainers will see that almost *ever* importers work the same way. The

Status report: the new importers are nearing completion

2016-11-11 Thread Edward K. Ream
Work is going extremely well. I expect to complete the conversion of the Python importer in a day or so. I have put a huge amount of work into the infrastructure of the code. The new code is much simpler than the old, and more flexible. As mentioned elsewhere, code generation now happens in

Re: A new pattern for me: `s.isspace()` instead of `not s.strip()`

2016-11-11 Thread Edward K. Ream
On Thursday, November 10, 2016 at 12:48:28 PM UTC-6, Edward K. Ream wrote: > > Up until today, I have always tested for an empty string using not > s.strip(). But Doh, this is an unnecessary stress on the GC. > `s.isspace()` much faster and more pythonic. > As another aspect of this pattern,