Title: Regular Expression instances
Type: Stage:
Components: Documentation Versions: Python 3.0, Python 2.4, Python 2.7, Python 2.6, Python 2.5
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: georg.brandl Nosy List: ecasbas, ezio.melotti, georg.brandl
Priority: normal Keywords:

Created on 2009-04-29 13:39 by ecasbas, last changed 2009-04-29 22:44 by georg.brandl. This issue is now closed.

Messages (3)
msg86803 - (view) Author: Emilio (ecasbas) Date: 2009-04-29 13:39
Following the example from

If I execute the following code on the python shell (3.1a1):

>>> import re
>>> p = re.compile('ab*')
>>> p

I get the msg:
<_sre.SRE_Pattern object at 0x013A3440>

instead of the msg from the example:
<re.RegexObject instance at 80b4150>

Why I get an SRE_Patterns object instead of a RegexObject instance?

Confirmed with another users

msg86805 - (view) Author: Ezio Melotti (ezio.melotti) * (Python committer) Date: 2009-04-29 13:53
Looks like a documentation bug, afaik it has always been
<_sre.SRE_Pattern object at 0x00A0BB78> (just checked on Python >=2.4).
Maybe it used to be <re.RegexObject instance at 80b4150> in older versions.
msg86832 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2009-04-29 22:44
The output is probably from the stone-aged original re module.  Fixed in
Date User Action Args
2009-04-29 22:44:19georg.brandlsetstatus: open -> closed
resolution: fixed
messages: + msg86832
2009-04-29 13:53:24ezio.melottisetnosy: + ezio.melotti

messages: + msg86805
versions: + Python 2.6, Python 2.5, Python 2.4, Python 2.7
2009-04-29 13:39:35ecasbascreate