regex into str

Peter Kleiweg in.aqua.scribis at nl.invalid
Sat Aug 28 22:08:57 EDT 2004


Jeff Epler schreef:

> This is intended to be impossible.

That i svery annoying.

> Even if you could assign to str.__div__ (and this is very deliberately and
> specifically disallowed) you would end up disappointed, because strings
> are immutable.  That means there's nowhere to store "the last match",
> no way to mutate the string with the "/=" operator, and also that the
> interpreter is free to use the same storage for two equal strings.

This works:

    a += 'x'

So this should too:

    a /= 'x'




Is there a way to tell Python that '' should be something else
than str?

-- 
Peter Kleiweg  L:NL,af,da,de,en,ia,nds,no,sv,(fr,it)  S:NL,de,en,(da,ia)
info: http://www.let.rug.nl/~kleiweg/ls.html




More information about the Python-list mailing list