[Python-ideas] PEP 447 revisited

Nick Coghlan ncoghlan at gmail.com
Sat Jul 26 13:59:35 CEST 2014


On 26 July 2014 18:03, Ronald Oussoren <ronaldoussoren at mac.com> wrote:
> Hi,
>
> After a long hiatus I’ve done some updates to PEP 447 which proposes a new metaclass method that’s used in attribute resolution for normal and super instances. There have been two updates, the first one is trivial, the proposed method has a new name (__getdescriptor__).  The second change to the PEP is to add a Python pseudo implementation of object.__getattribute__ and super.__getattribute__ to make it easier to reason about the impact of the proposal.
>
> I’d like to move forward with this PEP, either to rejection or (preferable) to acceptance of the feature in some form. That said, I’m not too attached to the exact proposal, it just seems to be the minmal clean change that can be used to implement my use case for this.
>
> My use case is fairly obscure, but hopefully it is not too obscure :-).  The problem I have at the moment is basically that it is not possible to hook into the attribute resolution algorithm used by super.__getattribute__ and this PEP would solve that.

The use case seems reasonable to me, and the new slot name seems much
easier to document and explain than the previous iteration.

I'd like to see the PEP look into the inspect module and consider the
consequences for the functions there (e.g. another way for
getattr_static to miss methods), as well as any possible implications
for dir(). We had a few issues there with the enum changes for 3.4
(and some more serious ones with Argument Clinic) - it's not a
blocker, it's just nice going in to have some idea of the impact going
in :)

Cheers,
Nick.

-- 
Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia


More information about the Python-ideas mailing list