Greetings!

Perhaps I woke up too early this morning, but this behaviour has me baffled:

Python 3.1.1 (r311:74483, Aug 17 2009, 17:02:12) [MSC v.1500 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.

--> test = object()

--> setattr(test, 'example', 123)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'object' object has no attribute 'example'

Shouldn't setattr() be creating the 'example' attribute? Any tips greatly appreciated!

~Ethan~
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to