[Tutor] Regular Expresions instances

Emile van Sebille emile at fenx.com
Wed Apr 29 01:24:12 CEST 2009


Emile van Sebille wrote:
> Emilio Casbas wrote:
>> Hi,
>>
>> following the example from
>> http://docs.python.org/3.0/howto/regex.html
> 
> ...from version 3.0 docs...
> 
>>
>> 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>
> 
> 
> ... is the same as I get on version 2.5.  Coincidence?

Nope.  I just installed 3.1a2 and it's the same there.

Possibly a case of the documentation not keeping up with the release...

Emile


> 
>>
>> instead of the msg from the example:
>> <re.RegexObject instance at 80b4150>
>>
>> Why I get an SRE_Patterns object instead of a RegexObject instance?
>>
>> Regards
>> Emilio
>>
>>
>>
>>       _______________________________________________
>> Tutor maillist  -  Tutor at python.org
>> http://mail.python.org/mailman/listinfo/tutor
>>
> 
> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> http://mail.python.org/mailman/listinfo/tutor
> 



More information about the Tutor mailing list