[issue12870] Regex object should have introspection methods

2017-05-06 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- status: open -> pending ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https:

[issue12870] Regex object should have introspection methods

2012-11-18 Thread Ezio Melotti
Changes by Ezio Melotti : -- versions: +Python 3.4 -Python 3.3 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue12870] Regex object should have introspection methods

2011-09-07 Thread Ezio Melotti
Ezio Melotti added the comment: If there is a generic introspection method like the pcre_fullinfo you mentioned, and if it's also useful and used with other languages/libraries, then it might be considered. -- ___ Python tracker

[issue12870] Regex object should have introspection methods

2011-09-07 Thread Matt Chaput
Matt Chaput added the comment: Yes, it's an optimization of my code, not the regex, as I said. Believe me, it's not premature. I've listed two general use cases for the two methods. To me it seems obvious that having to test a large number of regexes against a string, and having to test a sin

[issue12870] Regex object should have introspection methods

2011-09-07 Thread Éric Araujo
Éric Araujo added the comment: I tend to agree with Ezio. Matt, maybe you could ask for other opinions on python-ideas? -- nosy: +eric.araujo ___ Python tracker ___ __

[issue12870] Regex object should have introspection methods

2011-09-07 Thread Ezio Melotti
Ezio Melotti added the comment: Limiting the number of calls to re.match sounds like an optimization to me, and I still think that the methods you proposed are too specific. -- ___ Python tracker

[issue12870] Regex object should have introspection methods

2011-09-06 Thread Matt Chaput
Matt Chaput added the comment: Ezio, no offense, but I think it's safe to say you've completely misunderstood this bug. It is not about "explaining what a regex matches" or optimizing the regex. Read the last sentences of the two paragraphs explaining the proposed methods for the use cases. T

[issue12870] Regex object should have introspection methods

2011-08-31 Thread Ezio Melotti
Ezio Melotti added the comment: These additions sounds more useful as an external tool than regex functions/methods. There are already a few tools able to "explain" what a regex matches. The use cases you proposed are too specific to deserve new methods, and using them programmatically sound

[issue12870] Regex object should have introspection methods

2011-08-31 Thread Matt Chaput
New submission from Matt Chaput : Several times in the recent past I've wished for the following methods on the regular expression object. These would allow me to speed up search and parsing code, by limiting the number of regex matches I need to try. literal_prefix(): Returns any literal stri