On Thu, Dec 2, 2021 at 2:24 AM David Mertz, Ph.D. <[email protected]> wrote:
>
> On Wed, Dec 1, 2021 at 9:24 AM Paul Moore <[email protected]> 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 -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/[email protected]/message/I6KJR7YPDJOCJDMFVOJXV7BRK6JICBIQ/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to