File tree Expand file tree Collapse file tree 7 files changed +11
-15
lines changed
Expand file tree Collapse file tree 7 files changed +11
-15
lines changed Original file line number Diff line number Diff line change 1- sphinx>=4.2.0,<5.0 .0
1+ sphinx>=5.1 .0
22furo>=2022.3.4
Original file line number Diff line number Diff line change @@ -263,7 +263,7 @@ effect at runtime:
263263 Abstract base classes and multiple inheritance
264264**********************************************
265265
266- Mypy supports Python :doc: `abstract base classes <library/abc >` (ABCs). Abstract classes
266+ Mypy supports Python :doc: `abstract base classes <python: library/abc >` (ABCs). Abstract classes
267267have at least one abstract method or property that must be implemented
268268by any *concrete * (non-abstract) subclass. You can define abstract base
269269classes using the :py:class: `abc.ABCMeta ` metaclass and the :py:func: `@abc.abstractmethod <abc.abstractmethod> `
@@ -371,8 +371,7 @@ property or an instance variable.
371371Slots
372372*****
373373
374- When a class has explicitly defined
375- `__slots__ <https://docs.python.org/3/reference/datamodel.html#slots >`_,
374+ When a class has explicitly defined :std:term: `__slots__ `,
376375mypy will check that all attributes assigned to are members of ``__slots__ ``:
377376
378377.. code-block :: python
Original file line number Diff line number Diff line change @@ -238,10 +238,8 @@ section of the command line docs.
238238 Crafting a single regular expression that excludes multiple files while remaining
239239 human-readable can be a challenge. The above example demonstrates one approach.
240240 ``(?x) `` enables the ``VERBOSE `` flag for the subsequent regular expression, which
241- `ignores most whitespace and supports comments `__. The above is equivalent to:
242- ``(^one\.py$|two\.pyi$|^three\.) ``.
243-
244- .. __ : https://docs.python.org/3/library/re.html#re.X
241+ :py:data: `ignores most whitespace and supports comments <re.VERBOSE> `.
242+ The above is equivalent to: ``(^one\.py$|two\.pyi$|^three\.) ``.
245243
246244 For more details, see :option: `--exclude <mypy --exclude> `.
247245
Original file line number Diff line number Diff line change @@ -524,8 +524,7 @@ that only existed during type-checking.
524524In runtime it fails with expected ``NameError ``,
525525which can cause real problem in production, hidden from mypy.
526526
527- But, in Python3.11 ``reveal_type ``
528- `was added to typing.py <https://docs.python.org/3/library/typing.html#typing.reveal_type >`_.
527+ But, in Python3.11 :py:func: `typing.reveal_type ` was added.
529528``typing_extensions `` ported this helper to all supported Python versions.
530529
531530Now users can actually import ``reveal_type `` to make the runtime code safe.
Original file line number Diff line number Diff line change @@ -256,8 +256,7 @@ Mypy can also understand how to work with types from libraries that you use.
256256
257257For instance, mypy comes out of the box with an intimate knowledge of the
258258Python standard library. For example, here is a function which uses the
259- ``Path `` object from the
260- `pathlib standard library module <https://docs.python.org/3/library/pathlib.html >`_:
259+ ``Path `` object from the :doc: `pathlib standard library module <python:library/pathlib >`:
261260
262261.. code-block :: python
263262
Original file line number Diff line number Diff line change 99from sphinx .addnodes import document
1010from sphinx .application import Sphinx
1111from sphinx .builders .html import StandaloneHTMLBuilder
12+ from sphinx .environment import BuildEnvironment
1213
1314
1415class MypyHTMLBuilder (StandaloneHTMLBuilder ):
15- def __init__ (self , app : Sphinx ) -> None :
16- super ().__init__ (app )
16+ def __init__ (self , app : Sphinx , env : BuildEnvironment ) -> None :
17+ super ().__init__ (app , env )
1718 self ._ref_to_doc = {}
1819
1920 def write_doc (self , docname : str , doctree : document ) -> None :
Original file line number Diff line number Diff line change @@ -829,7 +829,7 @@ Typing async/await
829829
830830Mypy lets you type coroutines that use the ``async/await `` syntax.
831831For more information regarding coroutines, see :pep: `492 ` and the
832- `asyncio documentation <https://docs. python.org/3/ library/asyncio.html >`_.
832+ `asyncio documentation <python: library/asyncio >`_.
833833
834834Functions defined using ``async def `` are typed similar to normal functions.
835835The return type annotation should be the same as the type of the value you
You can’t perform that action at this time.
0 commit comments