This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Regular Expression instances
Type: Stage:
Components: Documentation Versions: Python 3.0, Python 2.4, Python 2.7, Python 2.6, Python 2.5
process
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 2022-04-11 14:56 by admin. This issue is now closed.

Messages (3)
msg86803 - (view) Author: Emilio (ecasbas) Date: 2009-04-29 13:39
Following the example from
http://docs.python.org/3.0/howto/regex.html

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
http://www.mail-archive.com/tutor@python.org/msg35017.html

Thanks
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
r72132.
History
Date User Action Args
2022-04-11 14:56:48adminsetgithub: 50128
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