__sub__ for string

Andrew Dalke dalke at acm.org
Fri Apr 13 06:24:48 EDT 2001


Rikard Bosnjakovic:
> (a + b) - b == a
>
>that won't occur if I do it my way.   Oh well, just a though.

Then for completeness (not that I'm proposing it!)

  "ab ab ab " / "ab " == 3

Since 5/2 == 2, this would also mean

  "ababa" / "ab" == 2

And if Python 3K makes 5/2 == 2.5 then this becomes true

  "ababa" / "ab" == 2.5

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

                    Andrew
                    dalke at acm.org






More information about the Python-list mailing list