Prothon Prototypes vs Python Classes

Paul Prescod paul at prescod.net
Sun Mar 28 09:48:52 EST 2004


John Roth wrote:

> It's certainly true that in a prototype based language all objects
> exist: there are no objects that the compiler deals with but does
> not put into the resulting program. And it's quite true that it does
> open up the floodgates for a lot of messiness.

Ummm. This is also true for Python. Python classes exist at runtime.

foo = 5

class foo: # oops. I've overwritten foo
	def bar(self):
		pass

print foo
print dir(foo)
print type(foo)

  Paul Prescod






More information about the Python-list mailing list