Explicit Frustration of the Self

DeadWisdom DeadWisdom at wisefool.net
Sat Jan 4 09:25:06 CET 2003


Another thought: how OO is Python?  It allows me to create Objects, I
guess.  But do these objects really have methods?  I don't think so. 
Not with the way self acts now.  Right now, you are effectively,
creating functions and then calling them with the first argument
outside of the parenthesis, and to the left of the function, and a
dot.


Observe:
>>> class Object:
... 	name = "Bob"
... 	
>>> def foo(self, argument):
... 	print argument + self.name
... 	
>>> o = Object()
>>> foo(o, "Hello ")
Hello Bob


Which is pretty much the same as:
>>> class Object:
... 	name = "Bob"
... 	def foo(self, argument):
... 		print argument + self.name
... 		
>>> o = Object()
>>> o.foo("Hello ")
Hello Bob


I really don't see much of a difference between foo(o, "Hello ") and
o.foo("Hello ").  It must be easy from the point of view of the python
programming, all you bassically do is mangle it to "Object_foo(self,
blah)", and pre-process all "object.foo(" to "object_foo(".  Seems to
be.
So the only real difference is that Object.foo won't conflict with
OtherObject.foo.  But that doesn't seem like the basis of OO.
In the end OOP is all about the revolution, not of efficiency or
computational effectiveness, but of how we can understand the
structure of the world that we create, its objects, its functions. 
The idea of the explicit self retards this understanding, I believe,
and forces us to view python objects as code, not objects of a
pseudo-reality.

Or perhaps I ask for too much of this time, two-thousand and three.




More information about the Python-list mailing list