8000 Add additional Unpack/kwargs conformance test cases by yangdanny97 · Pull Request #1918 · python/typing · GitHub
[go: up one dir, main page]

Skip to content

Add additional Unpack/kwargs conformance test cases #1918

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

Merged
merged 20 commits into from
Feb 6, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix build errors
  • Loading branch information
yangdanny97 committed Nov 7, 2024
commit 9db1d7c36f9a786f3fc42274f5e8a89e24a4ff6d
20 changes: 8 additions & 12 deletions docs/guides/writing_stubs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,9 @@ It may be instructive to examine `typeshed <https://github.com/python/typeshed/>
`setup for testing stubs <https://github.com/python/typeshed/blob/main/tests/README.md>`__.

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

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

.. _undocumented-objects:

Undocumented Objects
--------------------

Expand Down Expand Up @@ -532,7 +530,7 @@ Yes::

class Color(Enum):
# An assignment with no type annotation is a convention used to indicate
# an enum member.
# an enum member.
RED = 1

No::
Expand Down Expand Up @@ -770,10 +768,8 @@ Imports

Imports in stubs are considered private (not part of the exported API)
unless:
* they use the form ``from library import name as name`` (sic, using
explicit ``as`` even if the name stays the same); or
* they use the form ``from library import *`` which means all names
from that library are exported.
* they use the form ``from library import name as name`` (sic, using explicit ``as`` even if the name stays the same); or
* they use the form ``from library import *`` which means all names from that library are exported.

Forward References
------------------
Expand Down
0