R. David Murray <rdmur...@bitdance.com> added the comment:

But an object to which you can assign attributes but which has no methods can 
be useful in a number of contexts.  It's not a glorified dict, because 
attribute-style access is different from dict-style access.  The main place I 
have used this (creating my own trivial object subclass) is for passing a 
duck-typed object in to a function that only needs to access certain attributes 
to get the correct quack.

Why prevent us from using an object instance for this if there's not a 
functional reason for it?  Python is supposed to be a Consulting Adults 
language, after all :).

That said, I suspect that giving object a dict would break various assumptions 
in the core code, and I have no problem with creating that trivial subclass.  
It does have the advantage of providing a more meaningful name in error 
messages.

----------
nosy: +r.david.murray

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue7659>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to