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
2
2
furo>=2022.3.4
Original file line number Diff line number Diff line change @@ -263,7 +263,7 @@ effect at runtime:
263
263
Abstract base classes and multiple inheritance
264
264
**********************************************
265
265
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
267
267
have at least one abstract method or property that must be implemented
268
268
by any *concrete * (non-abstract) subclass. You can define abstract base
269
269
classes using the :py:class: `abc.ABCMeta ` metaclass and the :py:func: `@abc.abstractmethod <abc.abstractmethod> `
@@ -371,8 +371,7 @@ property or an instance variable.
371
371
Slots
372
372
*****
373
373
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__ `,
376
375
mypy will check that all attributes assigned to are members of ``__slots__ ``:
377
376
378
377
.. code-block :: python
Original file line number Diff line number Diff line change @@ -238,10 +238,8 @@ section of the command line docs.
238
238
Crafting a single regular expression that excludes multiple files while remaining
239
239
human-readable can be a challenge. The above example demonstrates one approach.
240
240
``(?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\.) ``.
245
243
246
244
For more details, see :option: `--exclude <mypy --exclude> `.
247
245
Original file line number Diff line number Diff line change @@ -524,8 +524,7 @@ that only existed during type-checking.
524
524
In runtime it fails with expected ``NameError ``,
525
525
which can cause real problem in production, hidden from mypy.
526
526
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.
529
528
``typing_extensions `` ported this helper to all supported Python versions.
530
529
531
530
Now 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.
256
256
257
257
For instance, mypy comes out of the box with an intimate knowledge of the
258
258
Python 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 >`:
261
260
262
261
.. code-block :: python
263
262
Original file line number Diff line number Diff line change 9
9
from sphinx .addnodes import document
10
10
from sphinx .application import Sphinx
11
11
from sphinx .builders .html import StandaloneHTMLBuilder
12
+ from sphinx .environment import BuildEnvironment
12
13
13
14
14
15
class 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 )
17
18
self ._ref_to_doc = {}
18
19
19
20
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
829
829
830
830
Mypy lets you type coroutines that use the ``async/await `` syntax.
831
831
For 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 >`_.
833
833
834
834
Functions defined using ``async def `` are typed similar to normal functions.
835
835
The 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