__sub__ for string

Rikard Bosnjakovic bos at hack.org
Fri Apr 13 06:47:43 EDT 2001


Andrew Dalke wrote:

> So what does "abc" / "ab" equal?

I'll show the Pike-eqvivalents:


> string s = "this is a string";
Result: "this is a string"
> s / " ";
Result: ({ /* 4 elements */
            "this",
            "is",
            "a",
            "string"
        })
> s - " ";
Result: "thisisastring"
> s * 2;
Result: "this is a stringthis is a string"
> s + s;
Result: "this is a stringthis is a string"


Since they exists in Pike, I just wondered the reason why they don't
exist in Python. And I've got the answer for that by now.


-- 
Rikard Bosnjakovic - http://bos.hack.org/cv/ - ICQ: 1158217

Anyone sending unwanted advertising e-mail to my address will be
charged $250 for network traffic and computing time. By extracting my
address from this message or its header, you agree to these terms.



More information about the Python-list mailing list