Is x.f() <==>MyClass.f(x) a kind of algebraic structure?

Paul Boddie paul at
Mon Oct 23 14:03:19 CEST 2006

steve wrote:
> I thought that when read Guido van Rossum' Python tutorial.What can we
> think that?

That x.f() is equivalent to MyClass.f(x)? (Consider restating questions
in the body of messages to maintain context, by the way.)

Why not try it out?

>>> class MyClass:
...     def f(self):
...             print "I am", self
>>> x = MyClass()
>>> x.f()
I am <__main__.MyClass instance at 0x2a955d5b00>
>>> MyClass.f(x)
I am <__main__.MyClass instance at 0x2a955d5b00>


More information about the Python-list mailing list