Commit d2d599f
Merge the specification portion of the "Type Stubs" doc into the spec (#1815)
* Type Stubs: move intro and syntax to spec.
* Moves some content into spec, deletes duplicate spec content.
* Adds placeholders for where remaining content will be moved. It will be
split between the spec and the writing_stubs doc.
* Move "Stub Contents" to writing_stubs.
Moves the section on what to include in stubs with editorial changes only -
e.g., changing "type stub" to "stub file" to match surrounding terminology.
* Moves "Style Guide" to writing_stubs doc.
Moves the style guide with a few updates:
* Editorial changes like tweaking code examples to use recommended style.
* Attribute declarations can use assignments when needed to convey extra
information - e.g., final attributes and enum members.
* Tweaks a reference to the double-underscore convention for positional-only
arguments to note that it's historical.
* Change :ref:`stubs` occurrences to :ref:`stub-files`.
* Move a few "Supported Constructs" sections into spec.
The only substantive change is an update to "Comments" to note that many
formats of error suppression comments are allowed.
* Migrated "Imports" and "Module Level Attributes" supported constructs.
Added `x: Final = <literal>` to module-level attributes section.
No other changes.
* Migrate "Enums" supported construct section.
Replaces outdated info with a link to the enums section of the spec.
* Move "Classes" and "Decorators" supported constructs sections.
Added an example of an inner class to "Classes." Removed mention of
asyncio.coroutine from "Decorators" as it's very deprecated. Added functions
decorated with `@dataclass_transform` to list of decorators that type
checkers should recognize.
* Port "Functions and Methods" supported constructs section.
Removed mention of individual supported/unsupported features from this
section. Where we state that all typing features from the latest released
version are supported, added a caveat with a link to the typeshed feature
tracker.
* Adds an "Import Conventions" section (deduplication).
* Remove missed reference to deleted stubs doc.
* Fix broken refs.
* Formatting fix to docs/guides/writing_stubs.rst
Co-authored-by: Sebastian Rittau <[email protected]>
* Reword paragraph on argument names to be more concise.
Co-authored-by: Sebastian Rittau <[email protected]>
* Wording clarification in docs/guides/writing_stubs.rst
Co-authored-by: Sebastian Rittau <[email protected]>
* Modernize code example in docs/guides/writing_stubs.rst
Co-authored-by: Sebastian Rittau <[email protected]>
* Typo fix in docs/spec/distributing.rst
Co-authored-by: Sebastian Rittau <[email protected]>
* Typo fix in docs/spec/distributing.rst
Co-authored-by: Sebastian Rittau <[email protected]>
* Grammar fixes
* Property deleters should also be understood.
* Address future notes.
* Fix silly formatting error.
* Undelete stubs.rst.
* Address review comments.
* Reword some sections to focus on type checker behavior.
* Move or remove some sections that fit better in the writing_stubs guide or
are redundant.
* Address more review comments.
Cuts redundant sections, moves things to writing_stubs, tries out a new
"these should be supported fully" and "these should be supported to at least
the described minimum" structure.
* Remove no-longer-needed anchor.
* And add back an accidentally deleted newline...
* Slight rewording of Decorators advice.
* Address more reviewer comments.
Moves "Library Interface" into spec, further trims redundant text.
* Remove extra colon.
* Revert changes to wrting_stubs that should be made separately.
* Delete unnecessary sentence.
Co-authored-by: Carl Meyer <[email protected]>
* Clarify some language and terminology.
* Address reviewer feedback.
* Formatting
* Drop "annotation contexts."
* Add "in annotation expressions" to newer syntax explanation.
* Update docs/spec/distributing.rst
Co-authored-by: Jelle Zijlstra <[email protected]>
* Reword syntax section.
* Update docs/spec/distributing.rst
Co-authored-by: Jelle Zijlstra <[email protected]>
* [pre-commit.ci] auto fixes from pre-commit.com hooks
---------
Co-authored-by: Sebastian Rittau <[email protected]>
Co-authored-by: Carl Meyer <[email protected]>
Co-authored-by: Jelle Zijlstra <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>1 parent e74d960 commit d2d599f
File tree
7 files changed
+209
-548
lines changed- docs
- guides
- reference
- spec
7 files changed
+209
-548
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
46 | | - | |
| 46 | + | |
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| |||
193 | 193 | | |
194 | 194 | | |
195 | 195 | | |
196 | | - | |
197 | | - | |
198 | | - | |
199 | | - | |
200 | | - | |
201 | | - | |
202 | | - | |
203 | | - | |
204 | | - | |
205 | | - | |
206 | | - | |
207 | | - | |
208 | | - | |
209 | | - | |
210 | | - | |
211 | | - | |
212 | | - | |
213 | | - | |
214 | | - | |
215 | | - | |
216 | | - | |
217 | | - | |
218 | | - | |
219 | | - | |
220 | | - | |
221 | | - | |
222 | | - | |
223 | | - | |
224 | | - | |
225 | | - | |
226 | | - | |
227 | | - | |
228 | | - | |
229 | | - | |
230 | | - | |
231 | | - | |
232 | | - | |
233 | | - | |
234 | | - | |
235 | | - | |
236 | | - | |
237 | | - | |
238 | | - | |
239 | | - | |
240 | | - | |
| 196 | + | |
| 197 | + | |
241 | 198 | | |
242 | 199 | | |
243 | 200 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
12 | 11 | | |
13 | 12 | | |
14 | 13 | | |
0 commit comments