On 02/09/2016 03:48 PM, Guido van Rossum wrote:

> (Assuming you meant Option*al*.) There seems to be an utter confusion
> of the two uses of the term "optional" here. An "optional argument"
> (outside PEP 484) is one that has a default value. The "Optional[T]"
> notation in PEP 484 means "Union[T, None]". They mean different
> things.

In an effort to be (crystal) clear:

option argument in Python: has a default value, so may be omitted when the function is called.

Optional[T] in MyPy: the argument has no default value, and must be supplied when the function is called, but the argument can be None.

--
~Ethan~
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to