[Python-ideas] Fwd: Define a method or function attributeoutsideof a class with the dot operator

Nick Coghlan ncoghlan at gmail.com
Sun Feb 12 16:36:20 EST 2017


On 12 February 2017 at 22:29, Nick Coghlan <ncoghlan at gmail.com> wrote:
> However, even with that, I'm still only +0 on the idea - if folks
> really want it, `types.new_class` can already be used to creatively to
> address most of these things, and it's not exactly a problem that
> comes up very often in practice.

I'll also note that much of what I'm talking about there could be
exposed as a types.bind_descriptor() function that implemented the
various adjustments (rebinding __class__ references is tricky though,
since the function with a bound closure variable might be hidden
inside another descriptor, like property)

Cheers,
Nick.

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


More information about the Python-ideas mailing list