
Jan. 17, 2021
12:26 a.m.
On 1/16/21 4:09 PM, Greg Ewing wrote:
On 17/01/21 12:31 pm, Larry Hastings wrote:
Consider the best practice for getting class annotations, example here from Lib/dataclasses.py:
cls_annotations = cls.__dict__.get('__annotations__', {})
Isn't that going to get broken anyway? It won't trigger the calling of __co_annotations__.
I proposed these as two separate conversations, because I wanted to clean up the semantics of annotations whether or not PEP 649 was accepted. But, yes, if PEP 649 is accepted (in some form), this current-best-practice would no longer work, and the new best practice would likely become much more complicated. Cheers, //arry/