On Apr 16, 3:28 am, "Daniel Nogradi" <[EMAIL PROTECTED]> wrote:
> I would expect all methods operating on a string instance
> and returning another string instance

Ok, then this:

class A(object):
    def __init__(self, s):
        self.s = s
    def strip(self):
        return self.s

class mystr(A):
    pass

x = mystr("x")
print isinstance(x, mystr)
print isinstance(x.strip(), mystr)


"x" is a string, and that is what gets passed to the base class's
__init__ method, and that is what strip() operates on.


-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to