[Python-Dev] 2.3b1, and object()

Mathieu Fenniak laotzu@pobox.com
Tue, 29 Apr 2003 20:16:18 -0600


I've been testing Python 2.3b1 since its release.  I've tested it with 
a number of applications I've written myself, as well as testing most 
of the new language features and modules out.  I've encountered no 
problems, and everything is happy and working.

On an unrelated note, I'm curious, what's the difference between an 
instance of an object, and an instance of an empty class?  Calling the 
object builtin returns an <object object at ...>, which I would expect 
would function the same as a 'class blah(object): pass', but they do 
not function similarly at all.

 >>> class A(object): pass
 >>> a = A()
 >>> a.i = 5
 >>> a.i
5
 >>>

 >>> a = object()
 >>> a.i = 5
Traceback (most recent call last):
   File "<stdin>", line 1, in ?
AttributeError: 'object' object has no attribute 'i'

--
Random words of the day:
  Who does not trust enough will not be trusted.
                                                         Lao-Tzu

  Mathieu Fenniak <laotzu@pobox.com>
  PGP Key ID 0x2459092A
  http://www.stompstompstomp.com/