Skip to content

Commit 9db1d7c

Browse files
committed
fix build errors
1 parent 13678bd commit 9db1d7c

File tree

1 file changed

+8
-12
lines changed

1 file changed

+8
-12
lines changed

docs/guides/writing_stubs.rst

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -94,13 +94,9 @@ It may be instructive to examine `typeshed <https://github.com/python/typeshed/>
9494
`setup for testing stubs <https://github.com/python/typeshed/blob/main/tests/README.md>`__.
9595

9696
To suppress type errors on stubs:
97-
* use mypy error codes for mypy-specific `# type: ignore` annotations,
98-
e.g. `# type: ignore[override]` for Liskov Substitution Principle violations.
99-
* use pyright error codes for pyright-specific suppressions,
100-
e.g. `# pyright: ignore[reportGeneralTypeIssues]`.
101-
- pyright is configured to discard `# type: ignore` annotations.
102-
If you need both on the same line, mypy's annotation needs to go first,
103-
e.g. `# type: ignore[override] # pyright: ignore[reportGeneralTypeIssues]`.
97+
* use mypy error codes for mypy-specific `# type: ignore` annotations, e.g. `# type: ignore[override]` for Liskov Substitution Principle violations.
98+
* use pyright error codes for pyright-specific suppressions, e.g. `# pyright: ignore[reportGeneralTypeIssues]`. Pyright is configured to discard `# type: ignore` annotations.
99+
* If you need both on the same line, mypy's annotation needs to go first, e.g. `# type: ignore[override] # pyright: ignore[reportGeneralTypeIssues]`.
104100

105101
..
106102
TODO: consider adding examples and configurations for specific type checkers
@@ -147,6 +143,8 @@ The following should not be included in stubs:
147143
3. Protected modules that start with a single ``_`` char. However, when needed protected modules can still be added (see :ref:`undocumented-objects` section below)
148144
4. Tests
149145

146+
.. _undocumented-objects:
147+
150148
Undocumented Objects
151149
--------------------
152150

@@ -532,7 +530,7 @@ Yes::
532530

533531
class Color(Enum):
534532
# An assignment with no type annotation is a convention used to indicate
535-
# an enum member.
533+
# an enum member.
536534
RED = 1
537535

538536
No::
@@ -770,10 +768,8 @@ Imports
770768

771769
Imports in stubs are considered private (not part of the exported API)
772770
unless:
773-
* they use the form ``from library import name as name`` (sic, using
774-
explicit ``as`` even if the name stays the same); or
775-
* they use the form ``from library import *`` which means all names
776-
from that library are exported.
771+
* they use the form ``from library import name as name`` (sic, using explicit ``as`` even if the name stays the same); or
772+
* they use the form ``from library import *`` which means all names from that library are exported.
777773

778774
Forward References
779775
------------------

0 commit comments

Comments
 (0)