msg82569 - (view) |
Author: Michael Foord (michael.foord) *  |
Date: 2009-02-21 16:56 |
There is a useful Scanner class in the re module which is undocumented. See: http://mail.python.org/pipermail/python-dev/2003-April/035075.html http://www.evanfosmark.com/2009/02/sexy-lexing-with-python/ |
|
|
msg82658 - (view) |
Author: Raymond Hettinger (rhettinger) *  |
Date: 2009-02-24 04:57 |
Any opinions on whether this was intended to be exposed? |
|
|
msg84326 - (view) |
Author: Georg Brandl (georg.brandl) *  |
Date: 2009-03-28 19:15 |
The class is commented as being "experimental", and the interface probably could use improvement (it's a bit awkward to subclass Scanner), but since it's been around for so long, I guess enough people will be using it that we have to keep it that way and document it. Opinions? |
|
|
msg84435 - (view) |
Author: Benjamin Peterson (benjamin.peterson) *  |
Date: 2009-03-29 21:59 |
I'm sure people are already rely on the intimate details of this class, so why not? |
|
|
msg84447 - (view) |
Author: Matthew Barnett (mrabarnett) *  |
Date: 2009-03-30 00:55 |
FYI, I did tidy up the class and add a 'scaniter' method when I was working on issue #2636; it might yet see the light of day if it gets the go ahead! |
|
|
msg84907 - (view) |
Author: Georg Brandl (georg.brandl) *  |
Date: 2009-03-31 21:11 |
OK, so we'll wait for that. |
|
|
msg84914 - (view) |
Author: Raymond Hettinger (rhettinger) *  |
Date: 2009-03-31 21:19 |
Whether this should be exposed is up to effbot. It's his code. He knows its limitations and he made the original decision to leave it undocumented. |
|
|
msg84930 - (view) |
Author: Matthew Barnett (mrabarnett) *  |
Date: 2009-03-31 22:03 |
One of the limitations is that it identifies what matched by using capture groups, so if the expressions provided contain captures then it gets confused! :-) I handled that by 1) rejecting named captures and 2) changing unnamed captures into non-captures. |
|
|
msg86794 - (view) |
Author: Jeroen Ruigrok van der Werven (asmodai) *  |
Date: 2009-04-29 10:36 |
So far effbot hasn't said anything about this. So Frederik, was it intended to be exposed or not? |
|
|
msg86795 - (view) |
Author: Michael Foord (michael.foord) *  |
Date: 2009-04-29 10:39 |
Whether it was intended to be exposed or not it is known and used - and therefore we can't change the API without going through the usual deprecation process. As it is used and useful it should be documented. |
|
|
msg86796 - (view) |
Author: Jeroen Ruigrok van der Werven (asmodai) *  |
Date: 2009-04-29 10:41 |
OK, clear, then I'll see what I can do. |
|
|
msg88036 - (view) |
Author: Raymond Hettinger (rhettinger) *  |
Date: 2009-05-18 16:44 |
This is very old code, without a mature API. Will take a look at competing recipes to see if this is still the best way of doing this. Maybe it should return a generator instead of a list. Perhaps there should be some checking for re's that don't combine well. Also, would like to see it exercised on a number of common parsing tasks to see how well it holds up. Better to do this work than to expose what is there now and get hit with bug reports, feature requests, deprecations, and cases where is it almost the right tool for the job. |
|
|
msg88104 - (view) |
Author: Raymond Hettinger (rhettinger) *  |
Date: 2009-05-20 01:31 |
Looking back at the original thread, good reasons were expresses for not documenting this code but just leaving it in as an example. |
|
|