Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Doc] mypy skips check function return None as a common issue #4594

Merged
merged 5 commits into from Mar 27, 2018
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 6 additions & 0 deletions docs/source/common_issues.rst
Expand Up @@ -85,6 +85,12 @@ flagged as an error.
clarity about the latter use ``--follow-imports=error``. You can
read up about these and other useful flags in :ref:`command-line`.

- **A function annotated as returning non-optional type but returns ``None``
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, perhaps this should be:

annotated as returning a non-optional type returns None...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can make this small edit on the web yourself and then merge. No need to wait for OP.

and mypy doesn't complain** By default, the ``None`` value is considered
compatible with everything. See :ref:`optional` for details on strict
optional checking, which allows mypy to check ``None`` values precisely, and
will soon become default.

.. _silencing_checker:

Spurious errors and locally silencing the checker
Expand Down