summaryrefslogtreecommitdiffstats
path: root/Doc/library/typing.rst
Commit message (Collapse)AuthorAgeFilesLines
* [3.8] bpo-41824: Fix indentation issue in ForwardRef docs (#24495)Ken Jin2021-02-091-1/+1
|
* [3.8] bpo-41824: Add versionadded for typing.ForwardRef docs (#24224) (#24494)Ken Jin2021-02-091-0/+2
|
* Doc: fix typo in typing.Type docs (GH-23460)Miss Islington (bot)2020-11-221-1/+1
| | | | | (cherry picked from commit 5ef53a88f3130cfcf9a9be3abd2ff2f997902647) Co-authored-by: John Belmonte <john@neggie.net>
* [3.8] [doc] Fix link to abc.collections.Iterable (GH-22502) (#22504)Andre Delfino2020-10-111-1/+1
| | | | | | Automerge-Triggered-By: @gvanrossum. (cherry picked from commit d4b9edd5052a2d9ae3d2be69975cc933afb37737) Co-authored-by: Andre Delfino <adelfino@gmail.com>
* [doc] Fix link to abc.collections.Iterable (GH-22520)Miss Skeleton (bot)2020-10-031-2/+2
| | | | | | | | Missed this occurrence before, sorry. Also changed "the PEP" to "PEP". Automerge-Triggered-By: @gvanrossum (cherry picked from commit 3fe614893742faee3c64e6d974e11329a496424f) Co-authored-by: Andre Delfino <adelfino@gmail.com>
* [3.8] bpo-41624: fix documentation of typing.Coroutine (GH-21952). (#21983)Karthikeyan Singaravelan2020-08-281-1/+1
| | | | | | | (cherry picked from commit 8c58d2a216ca2b5965361df9b8d8944bc7d4854d) Co-authored-by: MingZhe Hu <humingzhework@163.com> Co-authored-by: MingZhe Hu <humingzhework@163.com>
* Fix typo in typing doc (GH-21879)Miss Islington (bot)2020-08-141-1/+1
| | | | | | Automerge-Triggered-By: @gvanrossum (cherry picked from commit fa5d7251987c70a9c5d58b59a0b36ac9287eaafa) Co-authored-by: Irit Katriel <iritkatriel@yahoo.com>
* bpo-33864: Clarify the docs for typing.ByteString (GH-21311)Miss Islington (bot)2020-07-041-1/+1
| | | | | (cherry picked from commit b40e434386cd94a367d4a256e3364771140160e7) Co-authored-by: Zackery Spytz <zspytz@gmail.com>
* bpo-40745: Fix typos in NewType docs (GH-20379)Miss Islington (bot)2020-05-261-2/+2
| | | | | (cherry picked from commit 2b0e654f91f28379c6c7ef5fd80e8754afb70935) Co-authored-by: ziheng <zihenglv@gmail.com>
* bpo-36320: Use the deprecated-removed directive for _field_types (GH-19370)Serhiy Storchaka2020-04-041-1/+1
|
* Add a missing space after a period in 'typing.TypedDict' documentation ↵Miss Islington (bot)2020-03-051-1/+1
| | | | | | | (GH-18784) (cherry picked from commit d4a09c13ddd91a9bc1b4ba76ff4e8a153334a1e2) Co-authored-by: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
* bpo-39572: Document ’total’ flag of TypedDict (GH-18554)Miss Islington (bot)2020-02-191-2/+14
| | | | | (cherry picked from commit ab6423fe2de0ed5f8a0dc86a9c7070229326b0f0) Co-authored-by: ananthan-123 <ananthakrishnan15.2001@gmail.com>
* bpo-38467: Fix argument name of typing functions (GH-16753)Miss Islington (bot)2019-10-131-2/+2
| | | | | (cherry picked from commit fdfe2833ace93021278fe4c41c40e1d08d70abf9) Co-authored-by: Sebastian Rittau <srittau@rittau.biz>
* bpo-28556: Remove another mention of metaclass of Generic in typing docs ↵Miss Islington (bot)2019-10-131-2/+2
| | | | | | | | | | (GH-16743) Metaclass was removed in Python 3.7 (there is already a `versionchanged` item about this). https://bugs.python.org/issue28556 (cherry picked from commit 8144095707f87bdee6f3e1bbb15283ea61381be6) Co-authored-by: Ivan Levkivskyi <levkivskyi@gmail.com>
* bpo-32996: Documentation fix-up. (GH-16646)Miss Islington (bot)2019-10-101-3/+4
| | | | | | | | | PR GH-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. (cherry picked from commit d47f0dd2e85ce032aebfedbde18cdb2e728fa79f) Co-authored-by: M. Eric Irrgang <mei2n@virginia.edu>
* bpo-28556: Update the opening note in typing docs (GH-16204)Miss Islington (bot)2019-09-161-4/+3
| | | | | | This PR replaces the old note mentioning that `typing` is a provisional module with a new one mentioning types are not enforced at runtime. I am not sure if there was any official announcement about making `typing` non-provisional, but _de-facto_ no new features were added during Python 3.7, and no backwards incompatible changes were made except for few small things that were considered bugs. (cherry picked from commit 81528ba2e81c39f4d6bca5b785e818c7d08b8501) Co-authored-by: Ivan Levkivskyi <levkivskyi@gmail.com>
* bpo-37814: Document the empty tuple type annotation syntax (GH-15208)Miss Islington (bot)2019-08-131-1/+2
| | | | | | | | | | https://bugs.python.org/issue37814: > The empty tuple syntax in type annotations, `Tuple[()]`, is not obvious from the examples given in the documentation (I naively expected `Tuple[]` to work); it has been documented in PEP 484 and in mypy, but not in the documentation for the typing module. https://bugs.python.org/issue37814 (cherry picked from commit 8a784af750fa82c8355903309e5089eb2b60c16b) Co-authored-by: Josh Holland <anowlcalledjosh@gmail.com>
* Document typing.ForwardRef (GH-14216)Miss Islington (bot)2019-06-191-0/+7
| | | | | (cherry picked from commit 809ff1181ccc09c3b629f3d0ec66e13eaa111b2e) Co-authored-by: Ivan Levkivskyi <levkivskyi@gmail.com>
* Improve version added references in `typing` module docs (GH-13457)Anthony Sottile2019-06-021-4/+18
|
* bpo-29262: Add get_origin() and get_args() introspection helpers to typing ↵Ivan Levkivskyi2019-05-301-0/+19
| | | | | | | | | | (GH-13685) This is an old feature request that appears from time to time. After a year of experimenting with various introspection capabilities in `typing_inspect` on PyPI, I propose to add these two most commonly used functions: `get_origin()` and `get_args()`. These are essentially thin public wrappers around private APIs: `__origin__` and `__args__`. As discussed in the issue and on the typing tracker, exposing some public helpers instead of `__origin__` and `__args__` directly will give us more flexibility if we will decide to update the internal representation, while still maintaining backwards compatibility. The implementation is very simple an is essentially a copy from `typing_inspect` with one exception: `ClassVar` was special-cased in `typing_inspect`, but I think this special-casing doesn't really help and only makes things more complicated.
* bpo-37058: PEP 544: Add Protocol to typing module (GH-13585)Ivan Levkivskyi2019-05-281-1/+97
| | | | | I tried to get rid of the `_ProtocolMeta`, but unfortunately it didn'y work. My idea to return a generic alias from `@runtime_checkable` made runtime protocols unpickleable. I am not sure what is worse (a custom metaclass or having some classes unpickleable), so I decided to stick with the status quo (since there were no complains so far). So essentially this is a copy of the implementation in `typing_extensions` with two modifications: * Rename `@runtime` to `@runtime_checkable` (plus corresponding updates). * Allow protocols that extend `collections.abc.Iterable` etc.
* bpo-37049: PEP 589: Add TypedDict to typing module (GH-13573)Ivan Levkivskyi2019-05-261-0/+33
| | | | The implementation is straightforward and essentially is just copied from `typing_extensions`.
* bpo-37046: PEP 586: Add Literal to typing module (#13572)Ivan Levkivskyi2019-05-261-0/+22
| | | | The implementation is straightforward and essentially is just copied from `typing_extensions`.
* bpo-37045: PEP 591: Add final qualifiers to typing module (GH-13571)Ivan Levkivskyi2019-05-261-0/+44
| | | | The implementation is straightforward, it just mimics `ClassVar` (since the latter is also a name/access qualifier, not really a type). Also it is essentially copied from `typing_extensions`.
* bpo-36972: Add SupportsIndex (GH-13448)Paul Dagnelie2019-05-221-0/+6
| | | | In order to support typing checks calling hex(), oct() and bin() on user-defined classes, a SupportIndex protocol is required. The ability to check these at runtime would be good to add for completeness sake. This is pretty much just a copy of SupportsInt with the names tweaked.
* Fix wrong indentation of a paragraph in documentation (GH-12868)cocoatomo2019-04-181-2/+2
| | | This paragraph doesn't seem to be a part of code, but merged into previous code block.
* bpo-35581: Document @typing.type_check_only (GH-11312)Sebastian Rittau2019-04-121-0/+18
|
* bpo-36320: Switch typing.NamedTuple from OrderedDict to regular dict (GH-12396)Raymond Hettinger2019-03-181-4/+14
| | | | | | Also, deprecate the *_field_types* attributes which duplicated the information in *\__annotations__*. https://bugs.python.org/issue36320
* Update the seealso entries for namedtuple() (GH-12373)Raymond Hettinger2019-03-161-1/+1
| | | | | | * Replace external recipe link with a link to the dataclasses module. * Highlight the class definition syntax for typing.NamedTuple and add an example for clarity.
* Fix the versionadded info for typing.NoReturn (GH-11880)Jack Wilsdon2019-02-151-1/+1
| | | The earliest version that `typing.NoReturn` appears in is [3.5.4rc1](https://docs.python.org/3/whatsnew/changelog.html#python-3-5-4-release-candidate-1)
* bpo-35631: Improve typing docs wrt abstract/concrete collection types (GH-11396)Ville Skyttä2019-01-041-8/+17
| | | | https://bugs.python.org/issue35631
* Add 2 missing commas (GH-10698)Boštjan Mejak2018-12-231-1/+1
|
* bpo-35341: Add generic version of OrderedDict to typing (GH-10850)Ismo Toijala2018-12-021-0/+6
|
* bpo-35089: Don't mention typing.io and typing.re (GH-10173)Sebastian Rittau2018-10-281-16/+9
| | | | https://bugs.python.org/issue35089
* bpo-35042: Use the :pep: role where a PEP is specified (#10036)Stéphane Wirtel2018-10-261-1/+1
|
* bpo-35044, doc: Use the :exc: role for the exceptions (GH-10037)Stéphane Wirtel2018-10-261-1/+1
|
* Clarify that Type[SomeTypeVar] is legal (#9585)Michael Lee2018-09-261-3/+6
| | | | | | Currently, the docs state that when doing `Type[X]`, X is only allowed to be a class, a union of classes, and Any. This pull request amends that sentence to clarify X may also be a typevar (or a union involving classes, Any, and TypeVars).
* bpo-34336: Don't promote possibility to leave out typing.Optional (#8677)Ville Skyttä2018-08-051-4/+12
|
* Document typing.NoReturn (GH-7107)Ivan Levkivskyi2018-05-251-0/+12
|
* bpo-28556: Don't simplify unions at runtime (GH-6841)Ivan Levkivskyi2018-05-181-4/+3
|
* Add AsyncContextManager to typing module documentation. (GH-6822)Travis DePrato2018-05-141-0/+6
|
* bpo-32284: Fix documentation of BinaryIO and TextIO (#4832)Sebastian Rittau2017-12-131-3/+3
|
* bpo-29879: Update typing documentation. (GH-4573)Ivan Levkivskyi2017-11-261-0/+12
| | | | - Add "version added: 3.5.2" note where it was missing. - Remove the mention that Reversible is new in 3.5.2
* bpo-31567: more decorator markup fixes in docs (GH-3959) (#3966)Éric Araujo2017-10-121-3/+3
|
* bpo-31564: Update typing documentation (GH-3696)topper-1232017-09-241-3/+9
| | | Mention that ``NewType`` can derive from another ``NewType``.
* bpo-30619: Clarify typing.Union documentation (GH-2326)khyox2017-06-221-1/+1
| | | When a class and its subclass are present, the latter is skipped.
* bpo-29974: Improve typing.TYPE_CHECKING example (GH-982)Mathias Rav2017-04-261-2/+7
| | | | | | | | * Fix PEP 8 (SomeType instead of some_type) * Add a function parameter annotation * Explain, using wording from PEP 484 and PEP 526, why one annotation is in quotes and another is not. Suggested by Ivan Levkevskyi.
* Improvements to typing documentation (#967)Jelle Zijlstra2017-04-081-7/+43
| | | | Documents a few omitted classes and adds NamedTuple methods.
* bpo-29481: add versionadded 3.6.1 to typing.Deque docs (#107)Mariatta2017-02-151-0/+2
|
* Issue #29198: Merge from 3.5Berker Peksag2017-02-041-2/+2
|\