On 25 July 2016 at 03:00, Guido van Rossum <gvanrossum at gmail.com> wrote: > 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 at gmail.com | Brisbane, Australia
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4