B
Barry Kelly
I'm running this version of Python:
Python 2.4.3 (#1, May 18 2006, 07:40:45)
[GCC 3.3.3 (cygwin special)] on cygwin
I read in the documentation that these two expressions are
interchangeable:
x.__getattribute__('name') <==> x.name
From "pydoc __getattribute__":
---8<---
Help on method-wrapper object:
__getattribute__ = class method-wrapper(object)
| Methods defined here:
|
| __call__(...)
| x.__call__(...) <==> x(...)
|
| __getattribute__(...)
| x.__getattribute__('name') <==> x.name
--->8---
Yet when I try this with the 'type' type, it doesn't work:
---8<---Traceback (most recent call last):
File "<stdin>", line 1, in ?
TypeError: descriptor '__getattribute__' requires a 'int' object but
received a 'str'
--->8---
Why is this?
-- Barry
Python 2.4.3 (#1, May 18 2006, 07:40:45)
[GCC 3.3.3 (cygwin special)] on cygwin
I read in the documentation that these two expressions are
interchangeable:
x.__getattribute__('name') <==> x.name
From "pydoc __getattribute__":
---8<---
Help on method-wrapper object:
__getattribute__ = class method-wrapper(object)
| Methods defined here:
|
| __call__(...)
| x.__call__(...) <==> x(...)
|
| __getattribute__(...)
| x.__getattribute__('name') <==> x.name
--->8---
Yet when I try this with the 'type' type, it doesn't work:
---8<---Traceback (most recent call last):
File "<stdin>", line 1, in ?
TypeError: descriptor '__getattribute__' requires a 'int' object but
received a 'str'
--->8---
Why is this?
-- Barry