
Dec. 1, 2021
3:26 p.m.
On Thu, Dec 2, 2021 at 2:24 AM David Mertz, Ph.D. <david.mertz@gmail.com> wrote:
On Wed, Dec 1, 2021 at 9:24 AM Paul Moore <p.f.moore@gmail.com> wrote:
I think that the only thing I might use it for is to make it easier to annotate defaults (as f(a: list[int] => []) rather than as f(a: list[int] | None = None).
Why not `f(a: Optional[list[int]] = None)`?
I'm not counting characters, but that form seems to express the intention better than either of the others IMHO.
"a: list[int] => []" fully expresses the intention IMO, but yes, Optional is usually better than "| None". That's just a minor spelling problem though. ChrisA