Skip to content

Commit a18a37e

Browse files
committed
[spec] Update typeshed language to conform to reality
* Describe typeshed as a "project", not a "repository". * While typeshed still contains third-party stubs, those are usually not distributed with type checkers, but available from PyPI. Update the language accordingly. * This also means that step 5 of the import resolution ordering should reference the stdlib only. * Fix the reference to another section. * Fix typo in section name.
1 parent 7b192dc commit a18a37e

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

docs/spec/distributing.rst

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -73,13 +73,14 @@ Additional notes on stub files:
7373
Any identifier not defined in the stub is therefore assumed to be of type
7474
``Any``.
7575

76-
The Typeshed Repo
77-
^^^^^^^^^^^^^^^^^
78-
79-
There is a `shared repository <https://github.com/python/typeshed>`_ where useful stubs are being
80-
collected. Policies regarding the stubs collected here are
81-
decided separately and reported in the repo's documentation.
76+
The Typeshed Project
77+
^^^^^^^^^^^^^^^^^^^^
8278

79+
The `typeshed project <https://github.com/python/typeshed>`_ contains type
80+
annotations for the standard library and a selection of third-party libraries
81+
that don't ship their own type annotations or stubs. Policies regarding the
82+
stubs collected there are decided separately and reported in the project's
83+
documentation.
8384

8485
Type information in libraries
8586
-----------------------------
@@ -194,13 +195,13 @@ Partial Stub Packages
194195
Many stub packages will only have part of the type interface for libraries
195196
completed, especially initially. For the benefit of type checking and code
196197
editors, packages can be "partial". This means modules not found in the stub
197-
package SHOULD be searched for in parts four and five of the module resolution
198-
order above, namely inline packages and typeshed.
198+
package SHOULD be searched for in part four of the module resolution
199+
order below, namely inline packages.
199200

200-
Type checkers should merge the stub package and runtime package or typeshed
201+
Type checkers should merge the stub package and runtime package
201202
directories. This can be thought of as the functional equivalent of copying the
202-
stub package into the same directory as the corresponding runtime package or
203-
typeshed folder and type checking the combined directory structure. Thus type
203+
stub package into the same directory as the corresponding runtime package
204+
and type checking the combined directory structure. Thus type
204205
checkers MUST maintain the normal resolution order of checking ``*.pyi`` before
205206
``*.py`` files.
206207

@@ -216,8 +217,8 @@ are considered complete unless a ``py.typed`` with ``partial\n`` is included.
216217

217218
.. _mro:
218219

219-
Import resolutiong ordering
220-
^^^^^^^^^^^^^^^^^^^^^^^^^^^
220+
Import resolution ordering
221+
^^^^^^^^^^^^^^^^^^^^^^^^^^
221222

222223
The following is the order in which type checkers supporting this specification SHOULD
223224
resolve modules containing type information:
@@ -238,8 +239,7 @@ resolve modules containing type information:
238239
bundled with the package SHOULD be used (be they in ``.pyi`` type
239240
stub files or inline in ``.py`` files).
240241

241-
5. Typeshed (if used) - Provides the stdlib types and several third party
242-
libraries.
242+
5. Typeshed (if used) - Provides the stdlib types.
243243

244244
If typecheckers identify a stub-only namespace package without the desired module
245245
in step 3, they should continue to step 4/5. Typecheckers should identify namespace packages

0 commit comments

Comments
 (0)