Movatterモバイル変換
[0]ホーム
[Python-Dev] Remove str.find in 3.0?
M.-A. Lemburgmal at egenix.com
Sun Aug 28 15:10:14 CEST 2005
Raymond Hettinger wrote:> [Guido]>>>Another observation: despite the derogatory remarks about regular>>expressions, they have one thing going for them: they provide a higher>>level of abstraction for string parsing, which this is all about.>>(They are higher level in that you don't have to be counting>>characters, which is about the lowest-level activity in programming -->>only counting bytes is lower!)>>>>Maybe if we had a *good* way of specifying string parsing we wouldn't>>be needing to call find() or index() so much at all! (A good example>>is the code that Raymond lifted from ConfigParser: a semicolon>>preceded by whitespace starts a comment, other semicolons don't.>>Surely there ought to be a better way to write that.)>> A higher level abstraction is surely the way to go.I may be missing something, but why invent yet another parsingmethod - we already have the re module. I'd suggest touse it :-)If re is not fast enough or you want more control over theparsing process, you could also have a look at mxTextTools:http://www.egenix.com/files/python/mxTextTools.html-- Marc-Andre LemburgeGenix.comProfessional Python Services directly from the Source (#1, Aug 28 2005)>>> Python/Zope Consulting and Support ...http://www.egenix.com/>>> mxODBC.Zope.Database.Adapter ...http://zope.egenix.com/>>> mxODBC, mxDateTime, mxTextTools ...http://python.egenix.com/________________________________________________________________________::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! ::::
More information about the Python-Devmailing list
[8]ページ先頭