-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Fri, May 09, 2008 at 03:33:03PM +1200, Greg Ewing wrote:
> Peter Todd wrote:
> 
> > If no __getattr__ is defined, __getattribute__ is essentially a
> > tp_getattr slot filler:
> > 
> > static PyObject *__pyx_tp_getattro_3foo_foo(PyObject *o, PyObject *n) {
> >     PyObject *v = __pyx_pf_3foo_3foo___getattribute__(o, n);
> >     return v;
> > }
> 
> What if a __getattr__ is inherited from a base class?
> 
> What if this class doesn't define a __getattr__, but
> another class that inherits from it does, and doesn't
> override __getattribute__?

My simplistic idea of the world breaks? :)

No, you are totally right. A __tp_getattro__ special method could be
defined, it'd be about ~15 lines of code I think, and another test case,
including error messages if __tp_getattro__ and either __getattribute__
or __getattr__ are defined. I'd be happy to do it, but I think it'd be
better to think about other cases like it first.

- -- 
http://petertodd.org 'peter'[:[EMAIL PROTECTED] 
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFII8op3bMhDbI9xWQRAsSIAJ95BRIQSBxXtvfabgqSniajkY7FcACfcehX
tLxL2KN/OG4gPtjqL4qvFIs=
=uRg9
-----END PGP SIGNATURE-----
_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev

Reply via email to