On Thu, Dec 2, 2021 at 2:24 AM David Mertz, Ph.D. <david.me...@gmail.com> wrote: > > On Wed, Dec 1, 2021 at 9:24 AM Paul Moore <p.f.mo...@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 _______________________________________________ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-le...@python.org https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mail.python.org/archives/list/python-ideas@python.org/message/I6KJR7YPDJOCJDMFVOJXV7BRK6JICBIQ/ Code of Conduct: http://python.org/psf/codeofconduct/