classification
Title: typing.Union doc incoherence in case a class and its subclass are present
Type: Stage: resolved
Components: Documentation Versions: Python 3.7, Python 3.6, Python 3.5
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: docs@python Nosy List: Mariatta, docs@python, khyox, levkivskyi
Priority: normal Keywords:

Created on 2017-06-10 00:38 by khyox, last changed 2017-06-23 02:18 by Mariatta. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 2326 merged khyox, 2017-06-22 08:32
PR 2337 merged Mariatta, 2017-06-23 01:43
PR 2338 merged Mariatta, 2017-06-23 02:12
Messages (6)
msg295593 - (view) Author: khyox (khyox) * Date: 2017-06-10 00:38
In https://docs.python.org/3.6/library/typing.html#typing.Union, when giving details for Union and in the case when a class and its subclass are present, the doc states:

    When a class and its subclass are present, the former is skipped, e.g.:

        Union[int, object] == object

But it is the example (and not the text) which is consistent with PEP 483:

    Corollary: Union[..., object, ...] returns object

So, the proposed correction would be substitute 'former' for 'latter':

    When a class and its subclass are present, the latter is skipped, e.g.:

        Union[int, object] == object
msg296219 - (view) Author: Ivan Levkivskyi (levkivskyi) * Date: 2017-06-16 22:14
Yes, you are right. Could you please make a PR at https://github.com/python/cpython/pulls ?
msg296627 - (view) Author: Mariatta Wijaya (Mariatta) * (Python committer) Date: 2017-06-22 13:14
New changeset 6580c19bbbe7bc9bc0884699afd69184f523b32e by Mariatta (khyox) in branch 'master':
bpo-30619: Clarify typing.Union documentation (GH-2326)
https://github.com/python/cpython/commit/6580c19bbbe7bc9bc0884699afd69184f523b32e
msg296658 - (view) Author: Mariatta Wijaya (Mariatta) * (Python committer) Date: 2017-06-23 01:53
New changeset 8baf78b98f3acd76e51a4381542ff1612911b18f by Mariatta in branch '3.6':
[3.6] bpo-30619: Clarify typing.Union documentation (GH-2326) (GH-2337)
https://github.com/python/cpython/commit/8baf78b98f3acd76e51a4381542ff1612911b18f
msg296660 - (view) Author: Mariatta Wijaya (Mariatta) * (Python committer) Date: 2017-06-23 02:18
New changeset ce1bd6ac7ffaf396157a9ceb55b281a3b196323f by Mariatta in branch '3.5':
[3.5] bpo-30619: Clarify typing.Union documentation (GH-2326) (GH-2338)
https://github.com/python/cpython/commit/ce1bd6ac7ffaf396157a9ceb55b281a3b196323f
msg296661 - (view) Author: Mariatta Wijaya (Mariatta) * (Python committer) Date: 2017-06-23 02:18
Fixed and backported to 3.5 and 3.6.
Thanks!
History
Date User Action Args
2017-06-23 02:18:36Mariattasetstatus: open -> closed
versions: + Python 3.7
messages: + msg296661

resolution: fixed
stage: backport needed -> resolved
2017-06-23 02:18:07Mariattasetmessages: + msg296660
2017-06-23 02:12:50Mariattasetpull_requests: + pull_request2381
2017-06-23 01:53:00Mariattasetmessages: + msg296658
2017-06-23 01:43:42Mariattasetpull_requests: + pull_request2380
2017-06-22 13:16:47Mariattasetstage: backport needed
2017-06-22 13:14:59Mariattasetnosy: + Mariatta
messages: + msg296627
2017-06-22 08:32:01khyoxsetpull_requests: + pull_request2375
2017-06-16 22:14:23levkivskyisetnosy: + levkivskyi
messages: + msg296219
2017-06-10 00:38:10khyoxcreate