30 Oct
2021
30 Oct
'21
7:47 p.m.
On 10/30/2021 10:40 AM, Chris Angelico wrote:
And, seeing something in help(fn) largely necessitates that the source code be retained. I don't know of any other way to do it. If you say that the default argument is "len(a)", then that's what help() should say.
"from __future__ import annotations" works by decompiling the AST into a string. From PEP 563: "The string form is obtained from the AST during the compilation step, which means that the string form might not preserve the exact formatting of the source." I'm not saying this is a better way to do it, but it is another way. And it might save some memory. I don't think the slight differences mentioned at the end of that sentence would make a difference in practice. Eric