-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Fix inconsistent strict_optional documentation #21661
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -618,15 +618,17 @@ section of the command line docs. | |
| :type: boolean | ||
| :default: True | ||
|
|
||
| Effectively disables checking of optional | ||
| types and ``None`` values. With this option, mypy doesn't | ||
| generally check the use of ``None`` values -- it is treated | ||
| as compatible with every type. | ||
| Enables checking of optional types and ``None`` values. | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You don't need to explain what the default does, IMO. Instead, explain what disabling this does. The previous documentation was better, it just needed a "When set to |
||
| Setting this option to ``false`` effectively disables checking | ||
| of optional types and ``None`` values. With | ||
| ``strict_optional = false``, mypy doesn't generally check the use | ||
| of ``None`` values -- it is treated as compatible with every type. | ||
|
|
||
| .. warning:: | ||
|
|
||
| ``strict_optional = false`` is evil. Avoid using it and definitely do | ||
| not use it without understanding what it does. | ||
| not use it without understanding what it does. See | ||
| :ref:`Kinds of types <strict_optional>` for more information. | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same. |
||
|
|
||
|
|
||
| Configuring warnings | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why does this say Kinds of types? Why do you need to link this when the documentation is right above?