-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Crossreferences to standard library in mypy docs, part 2 #7660
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
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 | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -254,8 +254,8 @@ For more information, see the :ref:`None and optional handling <none-and-optiona | |||||||||||
section of the command line docs. | ||||||||||||
|
||||||||||||
``no_implicit_optional`` (bool, default False) | ||||||||||||
Changes the treatment of arguments with a default value of None by not implicitly | ||||||||||||
making their type Optional. | ||||||||||||
Changes the treatment of arguments with a default value of ``None`` by not implicitly | ||||||||||||
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. I suppose the verbatim formatting was forgotten here, so added the 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. +1 |
||||||||||||
making their type :py:data:`~typing.Optional`. | ||||||||||||
|
||||||||||||
``strict_optional`` (bool, default True) | ||||||||||||
Enables or disables strict Optional checks. If False, mypy treats ``None`` | ||||||||||||
|
@@ -377,8 +377,9 @@ a list of import discovery options that may be used | |||||||||||
User home directory and environment variables will be expanded. | ||||||||||||
|
||||||||||||
``files`` (string) | ||||||||||||
|
||||||||||||
A comma-separated list of paths which should be checked by mypy if none are given on the command | ||||||||||||
line. Supports recursive file globbing using :doc:`library/glob`, where ``*`` (e.g. ``*.py``) matches | ||||||||||||
line. Supports recursive file globbing using :py:mod:`glob`, where ``*`` (e.g. ``*.py``) matches | ||||||||||||
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. Please advise here. Both links lead to the same target: the vs 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. I like the second better. So +1 to the change. (Do we use this 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. There are a few mypy/docs/source/additional_features.rst Line 69 in c95ecc1
mypy/docs/source/class_basics.rst Line 235 in c95ecc1
mypy/docs/source/config_file.rst Line 32 in c95ecc1
mypy/docs/source/error_code_list.rst Lines 545 to 546 in c95ecc1
Do you suggest to replace them with the appropriate 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. It doesn't seem necessary, since those other places all specify link text. We cannot hope to strive for 100% consistency everywhere. |
||||||||||||
files in the current directory and ``**/`` (e.g. ``**/*.py``) matches files in any directories below | ||||||||||||
the current one. User home directory and environment variables will be expanded. | ||||||||||||
|
||||||||||||
|
@@ -399,7 +400,7 @@ section of the command line docs. | |||||||||||
Specifies the OS platform for the target program, for example | ||||||||||||
``darwin`` or ``win32`` (meaning OS X or Windows, respectively). | ||||||||||||
The default is the current platform as revealed by Python's | ||||||||||||
``sys.platform`` variable. | ||||||||||||
:py:data:`sys.platform` variable. | ||||||||||||
|
||||||||||||
|
||||||||||||
Incremental mode | ||||||||||||
|
@@ -418,7 +419,7 @@ section of the command line docs. | |||||||||||
variable. | ||||||||||||
|
||||||||||||
Note that the cache is only read when incremental mode is enabled | ||||||||||||
but is always written to, unless the value is set to ``/dev/nul`` | ||||||||||||
but is always written to, unless the value is set to ``/dev/null`` | ||||||||||||
hoefling marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||
(UNIX) or ``nul`` (Windows). | ||||||||||||
|
||||||||||||
``skip_version_check`` (bool, default False) | ||||||||||||
|
@@ -462,7 +463,7 @@ section of the command line docs. | |||||||||||
Shows traceback on fatal error. | ||||||||||||
|
||||||||||||
``custom_typing_module`` (string) | ||||||||||||
Specifies a custom module to use as a substitute for the ``typing`` module. | ||||||||||||
Specifies a custom module to use as a substitute for the :py:mod:`typing` module. | ||||||||||||
|
||||||||||||
``custom_typeshed_dir`` (string) | ||||||||||||
Specifies an alternative directory to look for stubs instead of the | ||||||||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -54,10 +54,10 @@ less effective, unless you are careful. | |
Any vs. object | ||
-------------- | ||
|
||
The type ``object`` is another type that can have an instance of arbitrary | ||
type as a value. Unlike ``Any``, ``object`` is an ordinary static type (it | ||
The type :py:class:`object` is another type that can have an instance of arbitrary | ||
type as a value. Unlike ``Any``, :py:class:`object` is an ordinary static type (it | ||
is similar to ``Object`` in Java), and only operations valid for *all* | ||
types are accepted for ``object`` values. These are all valid: | ||
types are accepted for :py:class:`object` values. These are all valid: | ||
|
||
.. code-block:: python | ||
|
||
|
@@ -80,7 +80,7 @@ operations: | |
n = 1 # type: int | ||
n = o # Error! | ||
|
||
You can use ``cast()`` (see chapter :ref:`casts`) or ``isinstance`` to | ||
go from a general type such as ``object`` to a more specific | ||
type (subtype) such as ``int``. ``cast()`` is not needed with | ||
You can use :py:func:`~typing.cast` (see chapter :ref:`casts`) or :py:func:`isinstance` to | ||
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. 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. +1. The only time it's better not to add |
||
go from a general type such as :py:class:`object` to a more specific | ||
type (subtype) such as ``int``. :py:func:`~typing.cast` is not needed with | ||
dynamically typed values (values with type ``Any``). |
Uh oh!
There was an error while loading. Please reload this page.