[Cython] __getattribute__
Peter Todd
pete at petertodd.org
Mon May 5 05:37:49 CEST 2008
On Sun, May 04, 2008 at 01:15:32AM -0400, Peter Todd wrote:
> Here's my first patch. This correctly implements __getattribute__ and
> __getattr__ in the single class case. FWIW I also have a mercurial tree
> if it'd be better to pull from it than apply patches.
>
> I'm working on making subclasses behave correctly, I've got test cases
> written up showing where things fail, but no solutions to that written
> yet. The slot_tp_getattro stuff Stefan mentioned is useful though.
__getattr(ibute)__ support is now working with subclasses. The semantics
should match Python exactly if my test cases are correct. All that has
changed from the previous patch is that at compile time base classes are
checked for __getattr(ibute)__ methods and those methods are used if
found.
Attached is an hg bundle of the two commits.
--
http://petertodd.org 'peter'[:-1]@petertodd.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: getattr_support.hg
Type: application/octet-stream
Size: 2517 bytes
Desc: not available
Url : http://codespeak.net/pipermail/cython-dev/attachments/20080504/e2e831c7/attachment.obj
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://codespeak.net/pipermail/cython-dev/attachments/20080504/e2e831c7/attachment.pgp
More information about the Cython-dev
mailing list