FW: [Python-Dev] Noam's open regex requests
Haven't heard a peep on this one. Is anyone going to be miffed if I accept Noam's requests? Raymond Hettinger -----Original Message----- From: python-dev-bounces+python=rcn.com@python.org [mailto:python-dev-bounces+python=rcn.com@python.org] On Behalf Of Raymond Hettinger Sent: Saturday, September 18, 2004 6:34 PM To: python-dev@python.org Cc: 'Noam Raphael' Subject: [Python-Dev] Noam's open regex requests [Noam Raphael]
I've suggested three things that I think should be done in that case, and nobody objected.
1. Add a prominent note in the module contents page or in the module's main page, stating that some functionality can only be acheived by using compiled REs.
I would make that read "The methods of compiled regular expressions allow more options than their simplified function counterparts. Most non-trivial applications always use the compiled form."
2. Document the optional parameters which let you specify the start and end pos in the findall and finditer methods of a compiled RE object.
This seems reasonable to me. The API is already exposed and is useful. Why not document it. AFAICT, there are no plans to take away the functionality.
3. Add the optional parameter "flags" to the findall and finditer functions. Then, the four functions match, search, findall and finditer would have the same interface: function(pattern, string[, flags]).
This also seems reasonable to me. It is marginally useful and it may reduce the learning curve ever so slightly. There is nothing special about findall() and finditer() that makes them different from match() and search() with respect to flags. Raymond Hettinger _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/python%40rcn.com
Raymond> Haven't heard a peep on this one. Is anyone going to be miffed Raymond> if I accept Noam's requests? I thought most of the opinion (certainly from Fredrik and Guido) ran counter to the request. Skip
We're not against #1 and #2, which are just fixing the docs!
I don't know what /F thinks of #3, which is a small subset of the
original proposal (to add options that are already present for other
APIs), but I'm +0.5 on it. FWIW.
On Wed, 22 Sep 2004 16:43:42 -0500, Skip Montanaro
Raymond> Haven't heard a peep on this one. Is anyone going to be miffed Raymond> if I accept Noam's requests?
I thought most of the opinion (certainly from Fredrik and Guido) ran counter to the request.
Skip
_______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/guido%40python.org
-- --Guido van Rossum (home page: http://www.python.org/~guido/)
Raymond> Haven't heard a peep on this one. Is anyone going to be miffed Raymond> if I accept Noam's requests?
[Skip]
I thought most of the opinion (certainly from Fredrik and Guido) ran counter to the request.
IIRC, this is the part of the request that wasn't shot down. Originally, the OP wanted the function API to fully duplicate the method API. There were several reasons for not doing that: API stability; where to put the flags argument relative to the start/stop arguments; the functions were supposed to be kept simple; and there were unresolvable argument order conflicts. So, the remaining part of the request is more humble: document that the functions are not supposed to be full featured, fully document the existing API, and to give findall() and finditer() the same interface as the other functions. I sent Fred a note on the third part and will stick with whatever he says if there is a reply. Raymond
participants (3)
-
Guido van Rossum
-
Raymond Hettinger
-
Skip Montanaro