A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/2016-February/143250.html below:

[Python-Dev] Experiences with Creating PEP 484 Stub Files

[Python-Dev] Experiences with Creating PEP 484 Stub Files [Python-Dev] Experiences with Creating PEP 484 Stub FilesGuido van Rossum guido at python.org
Wed Feb 10 12:52:23 EST 2016
On Wed, Feb 10, 2016 at 1:11 AM, Phil Thompson
<phil at riverbankcomputing.com> wrote:
> I understand now. The documentation, as it stands, is correct and consistent but (to me) the meaning of Optional is completely counter-intuitive. What you suggest with str = ... is exactly what I need. Adding a section to the docs describing that should clear up the confusion.

I tried to add some clarity to the docs with this paragraph:

   Note that this is not the same concept as an optional argument,
   which is one that has a default.  An optional argument with a
   default needn't use the ``Optional`` qualifier on its type
   annotation (although it is inferred if the default is ``None``).
   A mandatory argument may still have an ``Optional`` type if an
   explicit value of ``None`` is allowed.

Should be live on docs.python.org with the next push (I don't recall
the delay, at most a day IIRC).

-- 
--Guido van Rossum (python.org/~guido)
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4