On Mon, 1 Feb 2010 09:39:59 -0600
Terry Brown <[email protected]> wrote:

> no checking on self => more support for duck typing?

Quack quack.

The code below works in 3.x but not in 2.x, not sure what the implications are

class A(object):

    def foo(self):
        self.bar()
    def bar(self):
        print('A bar')

class B(object):

    def bar(self):
        print('B bar')

x = B()

# to make this work in 2.x do `x.__class__ = A`

A.foo(x)

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/leo-editor?hl=en.

Reply via email to