A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2001-May/014533.html below:

[Python-Dev] Classes and Metaclasses in Smalltalk

[Python-Dev] Classes and Metaclasses in Smalltalk [Python-Dev] Classes and Metaclasses in SmalltalkGuido van Rossum guido@digicool.com
Wed, 02 May 2001 10:19:07 -0500
> Here's an implementation of what I currently use to track down
> the basemethod (taken from mx.Tools):

How am I supposed to use this?

I tried this:

    class B:
        def foo(self):
            print "B.foo"

    class C(B):
        def foo(self):
            print "C.foo"
            B.foo(self)
            print basemethod(self.foo) # Expect this to be B.foo

    class D(C):
        def foo(self):
            print "D.foo"
            C.foo(self)

    d = D()
    d.foo()

but the call to basemethod(self.foo) in C prints C.foo, not B.foo as
required.

--Guido van Rossum (home page: http://www.python.org/~guido/)



RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4