[Python-ideas] Improving Clarity of re Module

Popa Claudiu pcmanticore at gmail.com
Thu Nov 28 11:46:55 CET 2013


On 11/27/2013 11:06 AM, Ned Batchelder wrote:
>* While we're at it, how can it be that we haven't improved the __repr__ after all
*>* these years?
*>>*     >>> m = re.search("[ab]", "xay")
*>*     >>> m
*>*     <_sre.SRE_Match object at 0x10a2ce9f0>
*>>* _sre? SRE_Match? huh? :)
*>>

* --Ned.*

Actually, it's fixed in Python 3.4, see http://bugs.python.org/issue17087.

Python 3.4.0b1 (default:9c7ab3e68243, Nov 26 2013, 19:42:06)
[GCC 4.2.1 20070831 patched [FreeBSD]] on freebsd8
Type "help", "copyright", "credits" or "license" for more information.
>>> import re
>>> re.search('aaa', 'aaab')
<_sre.SRE_Match object; span=(0, 3), match='aaa'>
>>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20131128/6638e43e/attachment.html>


More information about the Python-ideas mailing list