Micael Jarniac
a98b273ce4
Replace usage of List[...] with list[...] in typing docs (GH-28821)
...
The ``List[...]`` form is deprecated since 3.9.
2021-10-09 11:33:37 +08:00
DonnaDia
edae42f99f
bpo-44925: [docs] Fix confusing deprecation notice for typing.IO (GH-28004)
2021-08-31 17:44:27 +08:00
Sebastian Rittau
dabb6e8ddd
bpo-44957: Promote PEP 604 syntax in typing docs (GH-27833)
...
* Use "X | Y" instead of "Union" where it makes sense.
* Mention that "X | Y" is equivalent to "Union[X, Y]" in Union section.
* Remove "Optional[X]" as shorthand for "Union[X, None]" as the new
shorthand is now "X | None".
* Mention that "Optional[X]" can be written as "X | None" in section
about "Optional".
Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>
2021-08-22 20:45:01 +02:00
Maximilian Hils
16b9be4861
bpo-44926: `get_type_hints`: Add note about type aliases with forward refs ( #27859 )
2021-08-20 07:36:51 -07:00
Ori Avtalion
f4367ba3c5
Doc: Change errant 3.10.0 to 3.10, to match other mentions (GH-27459)
2021-07-30 15:55:09 +02:00
Ken Jin
7aac3f6236
bpo-44353: Document that typing.NewType is now a class ( #27319 )
2021-07-24 10:53:49 +02:00
andrei kulakov
17f94e2888
bpo-43453: Update and re-add example to typing runtime_checkable ( #27013 )
...
Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>
2021-07-05 09:23:42 -07:00
Sebastian Rittau
8a76683cfb
bpo-38291: Remove mention of typing.io and typing.re again (GH-26113)
...
They were originally removed in GH-10173 per bpo-35089, but then
readded in GH-21574. Cf. bpo-38291 for decision to remove.
2021-06-14 07:45:19 -07:00
Jelle Zijlstra
87109f4d85
bpo-44001: improve Literal documentation (GH-25877)
2021-05-04 10:54:12 +02:00
Ken Jin
99fdd78200
bpo-43766: Fix TypeGuard docs ( #25660 )
2021-04-27 08:55:08 -07:00
Ken Jin
05ab4b60ab
bpo-43766: Implement PEP 647 (User-Defined Type Guards) in typing.py ( #25282 )
2021-04-27 07:31:04 -07:00
Jelle Zijlstra
522433601a
bpo-43783: Add ParamSpecArgs/Kwargs (GH-25298)
2021-04-10 19:57:05 -07:00
DevilXD
ac05f82ad4
bpo-41974: Remove part of the note regarding complex.__float__ (GH-25197)
...
(The deleted example no longer works and is thus irrelevant.)
2021-04-10 15:36:40 -07:00
Ken Jin
2b5913b4ee
bpo-41370: Add note about ForwardRefs and PEP585 generic types in docs ( #25183 )
2021-04-04 08:14:44 -07:00
Paul Bryan
1e3c68246e
bpo-43345: Enhance TypedDict documentation. ( #24668 )
2021-02-27 23:02:14 -08:00
Ken Jin
da21f7b6e1
bpo-41824: Add versionadded for typing.ForwardRef docs ( #24224 )
2021-02-08 17:58:50 -08:00
Ken Jin
ace008c531
Fix various ParamSpec errors in typing (GH-24176)
...
1. ParamSpec -> TypeVar for ``typing.Concatenate``
2. ParamSpec's call signature should align with its documentation.
Noticed in GH-24169
2021-01-10 16:11:41 -08:00
Johan Dahlin
68e1f259be
Fix a typo in docs for typing.Concatenate ( #24169 )
...
Return param spec should be R, not T
2021-01-08 10:08:21 -08:00
Ken Jin
11276cd9c4
bpo-41559: Documentation for PEP 612 (GH-24000)
2021-01-01 16:45:50 -08:00
John Belmonte
5ef53a88f3
Doc: fix typo in typing.Type docs (GH-23460)
2020-11-22 23:54:19 +09:00
kj
e1dc0db8c7
bpo-42345: Add whatsnew and versionchanged for typing.Literal in 3.9 (GH-23386)
...
* Whatsnew entry in 3.9 same as the one in 3.10.
* versionchanged for typing.Literal docs
Needs backport to 3.9.
2020-11-19 09:37:26 -08:00
Yurii Karabas
1b54077ff6
bpo-42345: Fix hash implementation of typing.Literal (GH-23383)
...
Fix hash implementation of `typing.Literal`.
Update docs regarding `typing.Litaral` caching.
Base implementation was done in PR #23294 .
2020-11-19 08:17:38 -08:00
Dominik1123
c3b9592244
bpo-42317: Improve docs of typing.get_args concerning Union (GH-23254)
2020-11-15 17:30:55 -08:00
kj
9129af6050
bpo-42198: Link to GenericAlias in typing and expressions (GH-23030)
...
Follow up to 7cdf30fff3
and 4173320920
. This addresses the point "1. Update links in typing, subscription and union to point to GenericAlias." in the bpo for this PR.
2020-10-29 21:01:17 -07:00
Andre Delfino
975d10a4f8
[doc] Add mentions of PEP 613 (TypeAlias) to docs (GH-22733)
2020-10-16 19:34:01 -07:00
Saiyang Gou
ba06a70c82
Fix typo in "Context manager types" section in typing.rst (GH-22676)
...
Fix typo in the "Context manager types" section in `typing.rst`.
Automerge-Triggered-By: @gvanrossum
2020-10-12 16:34:33 -07:00
abdo
0ff8a3b374
Fix typo in typing.rst (GH-22625)
2020-10-11 11:40:21 +05:30
Mikhail Golubev
4f3c25043d
bpo-41923: PEP 613: Add TypeAlias to typing module ( #22532 )
...
This special marker annotation is intended to help in distinguishing
proper PEP 484-compliant type aliases from regular top-level variable
assignments.
2020-10-07 14:44:31 -07:00
Fidget-Spinner
8e1dd55e63
bpo-41428: Documentation for PEP 604 (gh-22517)
2020-10-04 21:40:52 -07:00
Andre Delfino
7f54e563dc
[doc] Use list[int] instead of List[int] (etc.) in a few more places (GH-22524)
...
This changes a few occurrences left behind by #22340 .
Automerge-Triggered-By: @gvanrossum
2020-10-03 15:10:59 -07:00
Andre Delfino
3fe6148937
[doc] Fix link to abc.collections.Iterable (GH-22520)
...
Missed this occurrence before, sorry. Also changed "the PEP" to "PEP".
Automerge-Triggered-By: @gvanrossum
2020-10-03 08:51:13 -07:00
Andre Delfino
d4b9edd505
[doc] Fix link to abc.collections.Iterable (GH-22502)
...
Automerge-Triggered-By: @gvanrossum
2020-10-02 16:15:28 -07:00
Andre Delfino
bd71a43340
Fix is_typeddict markup ( #22501 )
2020-10-02 15:36:26 -07:00
Andre Delfino
d9ab95ff1f
[doc] Leverage the fact that the actual types can now be indexed for typing (GH-22340)
...
This shows users that they can use the actual types. Using deprecated types is confusing.
This also prefers colections.abc.Sized instead of the alias typing.Sized. I guess the aliases were created to make it convenient to import all collections related types from the same place.
This should be backported to 3.9.
Automerge-Triggered-By: @gvanrossum
2020-09-27 12:07:04 -07:00
Andre Delfino
83f6dcd207
[doc] Minor improvements to is_typeddict (GH-22280)
...
1. The check is on the type
2. Add link to TypeDict
2020-09-16 08:06:23 -07:00
Patrick Reader
0705ec8a14
bpo-41792: Add is_typeddict function to typing.py (GH-22254)
...
Closes issue41792.
Also closes https://github.com/python/typing/issues/751 .
2020-09-15 21:58:32 -07:00
Andre Delfino
5bfd60fc2b
[doc] Add link to Generic in typing (GH-22125)
2020-09-06 22:29:38 -07:00
Andre Delfino
2623868ede
[doc] Fix padding in some typing definitions (GH-22114)
...
Automerge-Triggered-By: @gvanrossum
2020-09-05 16:40:25 -07:00
MingZhe Hu
8c58d2a216
bpo-41624: fix documentation of typing.Coroutine (GH-21952)
2020-08-27 02:42:37 +02:00
Irit Katriel
fa5d725198
Fix typo in typing doc (GH-21879)
...
Automerge-Triggered-By: @gvanrossum
2020-08-14 16:01:36 -07:00
Luciano Ramalho
ab72fdeb82
bpo-40979: refactored typing.rst; (mostly) same content, new sub-sections and ordering ( #21574 )
...
Also added PEP 585 deprecation notes.
2020-08-02 15:32:36 -07:00
Zackery Spytz
b40e434386
bpo-33864: Clarify the docs for typing.ByteString (GH-21311)
2020-07-03 20:58:21 -07:00
ziheng
2b0e654f91
bpo-40745: Fix typos in NewType docs (GH-20379)
2020-05-25 21:45:35 -07:00
Serhiy Storchaka
6fed3c8540
bpo-40182: Remove the _field_types attribute of the NamedTuple class (GH-19368)
2020-04-05 00:43:20 +03:00
Miss Islington (bot)
d4a09c13dd
Add a missing space after a period in 'typing.TypedDict' documentation (GH-18784)
2020-03-04 16:12:28 -08:00
ananthan-123
ab6423fe2d
bpo-39572: Document ’total’ flag of TypedDict (GH-18554)
2020-02-18 20:33:05 -08:00
Jakub Stasiak
cf5b109dbb
bpo-39491: Merge PEP 593 (typing.Annotated) support ( #18260 )
...
* bpo-39491: Merge PEP 593 (typing.Annotated) support
PEP 593 has been accepted some time ago. I got a green light for merging
this from Till, so I went ahead and combined the code contributed to
typing_extensions[1] and the documentation from the PEP 593 text[2].
My changes were limited to:
* removing code designed for typing_extensions to run on older Python
versions
* removing some irrelevant parts of the PEP text when copying it over as
documentation and otherwise changing few small bits to better serve
the purpose
* changing the get_type_hints signature to match reality (parameter
names)
I wasn't entirely sure how to go about crediting the authors but I used
my best judgment, let me know if something needs changing in this
regard.
[1] 8280de241f/typing_extensions/src_py3/typing_extensions.py
[2] 17710b8798/pep-0593.rst
2020-02-04 17:10:19 -08:00
Sebastian Rittau
fdfe2833ac
bpo-38467: Fix argument name of typing functions (GH-16753)
2019-10-13 19:31:35 +01:00
Ivan Levkivskyi
8144095707
bpo-28556: Remove another mention of metaclass of Generic in typing docs (GH-16743)
...
Metaclass was removed in Python 3.7 (there is already a `versionchanged` item about this).
https://bugs.python.org/issue28556
2019-10-13 09:53:06 -07:00
M. Eric Irrgang
d47f0dd2e8
bpo-32996: Documentation fix-up. (GH-16646)
...
PR #4906 changed the typing.Generic class hierarchy, leaving an
outdated comment in the library reference. User-defined Generic ABCs now
must get a abc.ABCMeta metaclass from something other than typing.Generic
inheritance.
2019-10-10 12:11:33 +01:00