
May 13, 2021
6:42 p.m.
On 5/13/21 10:46 AM, Eric V. Smith wrote:
MISSING <class '__main__.MISSING'>
I think a repr of just "MISSING", or maybe "dataclasses.MISSING" would be better.
I literally just went down this road--for a while there was a special sentinel value for the eval_str parameter to inspect.get_annotations(). The repr I went with was "<id>", e.g "<MISSING>". It depends on how seriously you take the idea that eval(repr(x)) == x. Certainly most objects don't actually support that, e.g., uh, object(), a type which I understand is available in most Python implementations. Cheers, //arry/