[Python-ideas] Experiment: Adding "re" to string objects.

Sean Reifschneider jafo at tummy.com
Wed Jul 22 11:13:28 CEST 2009


On 07/21/2009 03:16 PM, Nick Coghlan wrote:
> It also just occurred to me that string interning completely destroys
> any concept of storing mutable attributes on strings:

So that would prevent "re" from being added to strings, right?  Is there
some way around that?  I can't think of one, beyond making a sub-class like
I've done in the filtertools example...

Which kind of makes the whole idea fall down, because the benefit of having
it directly in strings is that you don't then have to use a bunch of
different APIs like "file.rereadlines()" or "re.readlines(fp)" or
"re.open('filename')" or "re.file(fp)"...  At that point, I wonder if it
makes more sense to put the match() and group() methods on the refile
object instead of on the string it returns.

Opinions?

Sean
-- 
Sean Reifschneider, Member of Technical Staff <jafo at tummy.com>
tummy.com, ltd. - Linux Consulting since 1995: Ask me about High Availability

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 252 bytes
Desc: OpenPGP digital signature
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20090722/1c55dec5/attachment.pgp>


More information about the Python-ideas mailing list