By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,050 Members | 1,020 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,050 IT Pros & Developers. It's quick & easy.

__getattr__, __setattr__

P: n/a
Just wondering about this behaviour, why is it this way?

Python 2.4.2 (#67, Sep 28 2005, 12:41:11) [MSC v.1310 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
object.__setattr__ <slot wrapper '__setattr__' of 'object' objects> object.__getattr__ Traceback (most recent call last):
File "<stdin>", line 1, in ?
AttributeError: type object 'object' has no attribute '__getattr__'

Thanks,

Thomas
Oct 20 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
for new style classes __getattribute__ is defined, see eg.
http://www.python.org/2.2.3/descrintro.html

Oct 20 '05 #2

P: n/a
Thomas Heller wrote:
Just wondering about this behaviour, why is it this way?

Python 2.4.2 (#67, Sep 28 2005, 12:41:11) [MSC v.1310 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
object.__setattr__
<slot wrapper '__setattr__' of 'object' objects>
object.__getattr__
Traceback (most recent call last):
File "<stdin>", line 1, in ?
AttributeError: type object 'object' has no attribute '__getattr__'

Python 2.4.1 (#65, Mar 30 2005, 09:13:57) [MSC v.1310 32 bit (Intel)] on
win32
Type "help", "copyright", "credits" or "license" for more information.
object.__getattribute__

<slot wrapper '__getattribute__' of 'object' objects>

Ring any bells?

regards
Steve
--
Steve Holden +44 150 684 7255 +1 800 494 3119
Holden Web LLC www.holdenweb.com
PyCon TX 2006 www.python.org/pycon/

Oct 20 '05 #3

P: n/a
"wi******@hotmail.com" <ma**********@gmail.com> writes:
for new style classes __getattribute__ is defined, see eg.
http://www.python.org/2.2.3/descrintro.html


Steve Holden <st***@holdenweb.com> writes:
>>> object.__getattribute__

<slot wrapper '__getattribute__' of 'object' objects>

Ring any bells?


Yes, of course. Thanks ;-)

Thomas
Oct 20 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.