25 Jul
2016
25 Jul
'16
9:19 a.m.
On 25 July 2016 at 03:00, Guido van Rossum
Yes.
OK, we can cover that in the documentation - if folks want to emulate what happens during class construction after the fact, they'll need to do: cls.name = attr attr.__set_name__(cls, "name") Semantically, I agree that approach makes sense - by default, descriptors created outside a class body won't have a defined owning class or attribute name, and if you want to give them one, you'll have to do it explicitly. Cheers, Nick. -- Nick Coghlan | ncoghlan@gmail.com | Brisbane, Australia