Movatterモバイル変換
[0]ホーム
[Python-ideas] Fwd: Define a method or function attributeoutsideof a class with the dot operator
Nick Coghlanncoghlan 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 beexposed as a types.bind_descriptor() function that implemented thevarious adjustments (rebinding __class__ references is tricky though,since the function with a bound closure variable might be hiddeninside another descriptor, like property)Cheers,Nick.-- Nick Coghlan |ncoghlan at gmail.com | Brisbane, Australia
More information about the Python-ideasmailing list
[8]ページ先頭