[issue18181] super vs. someclass.__getattribute__

2013-07-15 Thread Ronald Oussoren
Ronald Oussoren added the comment: issue18181-locallookup-only-super.txt implements the current version of PEP 447, but only for the super object. In this version of the patch normal attribute lookup (object.__getattribute__ and PyObject_GenericGetAttr) are not yet affected. Another open iss

[issue18181] super vs. someclass.__getattribute__

2013-07-15 Thread Ronald Oussoren
Ronald Oussoren added the comment: There now is a PEP for this issue: . The current version of the PEP describes a different API than documented by the attached proposal and the prove of concept code. I'm working on an updated implementation.

[issue18181] super vs. someclass.__getattribute__

2013-07-03 Thread Ronald Oussoren
Ronald Oussoren added the comment: Also updated the draft PEP text -- Added file: http://bugs.python.org/file30767/super-hook-proposal.rst ___ Python tracker ___

[issue18181] super vs. someclass.__getattribute__

2013-07-03 Thread Ronald Oussoren
Changes by Ronald Oussoren : Removed file: http://bugs.python.org/file30556/super-hook-proposal.rst ___ Python tracker ___ ___ Python-bugs-lis

[issue18181] super vs. someclass.__getattribute__

2013-07-03 Thread Ronald Oussoren
Changes by Ronald Oussoren : Removed file: http://bugs.python.org/file30528/supers.py ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue18181] super vs. someclass.__getattribute__

2013-07-03 Thread Ronald Oussoren
Changes by Ronald Oussoren : Removed file: http://bugs.python.org/file30555/issue-18181-poc-v3.txt ___ Python tracker ___ ___ Python-bugs-list

[issue18181] super vs. someclass.__getattribute__

2013-07-03 Thread Ronald Oussoren
Changes by Ronald Oussoren : Removed file: http://bugs.python.org/file30546/issue-18181-poc.txt ___ Python tracker ___ ___ Python-bugs-list ma

[issue18181] super vs. someclass.__getattribute__

2013-07-03 Thread Ronald Oussoren
Ronald Oussoren added the comment: Updated version of the patch, with some semantic changes and tests for the Python level API. Known issues: * Patches uses tabs for indentation * No tests for the C level API * I don't like implementation of slot_tp_getattro_super -- Added file: htt

[issue18181] super vs. someclass.__getattribute__

2013-06-12 Thread Ronald Oussoren
Ronald Oussoren added the comment: Slightly updated patch (different names, added some documentation) -- Added file: http://bugs.python.org/file30555/issue-18181-poc-v3.txt ___ Python tracker __

[issue18181] super vs. someclass.__getattribute__

2013-06-12 Thread Ronald Oussoren
Ronald Oussoren added the comment: added draft of a pep-style proposal -- Added file: http://bugs.python.org/file30556/super-hook-proposal.rst ___ Python tracker ___

[issue18181] super vs. someclass.__getattribute__

2013-06-11 Thread Ronald Oussoren
Ronald Oussoren added the comment: I don't think it is possible to avoid adding a new slot. The default implementation of tp_getattro (PyObject_GenericGetAttr) looks in the instance dict, while super does not (because it wants a less specific implementation). PyObject_GenericGetAttr will als

[issue18181] super vs. someclass.__getattribute__

2013-06-11 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: Is it possible to avoid a new slot? for example, super() could walk the tp_base-> chain and call tp_getattro each time the value changes. -- ___ Python tracker _

[issue18181] super vs. someclass.__getattribute__

2013-06-11 Thread Ronald Oussoren
Ronald Oussoren added the comment: . -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/

[issue18181] super vs. someclass.__getattribute__

2013-06-11 Thread Ronald Oussoren
Ronald Oussoren added the comment: Second version of the poc adds a way to implement the hook in Python code, and supers_updated.py uses that hook. Still no tests, no documentation and with awfull naming :-) -- Added file: http://bugs.python.org/file30547/supers_updated.py ___

[issue18181] super vs. someclass.__getattribute__

2013-06-11 Thread Ronald Oussoren
Ronald Oussoren added the comment: I've attached a first very rough patch to demonstrate what I was rambling about. With this patch and a patched version of PyObjC I can use the builtin super class with the proxy classes for Objective-C classes. Open issues: * Does this need a pep? * The nam

[issue18181] super vs. someclass.__getattribute__

2013-06-10 Thread Ronald Oussoren
Ronald Oussoren added the comment: Looks like it. That issue was closed without a good reason though. -- ___ Python tracker ___ ___ Py

[issue18181] super vs. someclass.__getattribute__

2013-06-10 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: issue783528 was a bit similar. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Uns

[issue18181] super vs. someclass.__getattribute__

2013-06-10 Thread Ronald Oussoren
Ronald Oussoren added the comment: I didn't, but the attached script should do the trick. The code suffers badly from copy&paste editing, but more or less has the same behavior as PyObjC. It defines a subclass of list (MyList) with an append method, and more importantly also defines 3 "proxy"

[issue18181] super vs. someclass.__getattribute__

2013-06-10 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: Do you have an example in pure Python code? -- nosy: +amaury.forgeotdarc ___ Python tracker ___ __

[issue18181] super vs. someclass.__getattribute__

2013-06-10 Thread Ronald Oussoren
New submission from Ronald Oussoren: Super() walks the MRO and looks for the looked-up attribute in the __dict__ of types on the MRO. This can cause problems when classes implement __getattribute__: a class on the MRO can implement a method that super() won't find because it isn't in the class