This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: `__or__` is not covered for `_GenericAlias` and `_SpecialGenericAlias` in `typing`
Type: behavior Stage: resolved
Components: Tests Versions: Python 3.11, Python 3.10
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: kj, miss-islington, sobolevn
Priority: normal Keywords: patch

Created on 2022-01-17 14:57 by sobolevn, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 30640 merged sobolevn, 2022-01-17 14:59
PR 30693 closed miss-islington, 2022-01-19 15:32
PR 30694 merged miss-islington, 2022-01-19 15:32
Messages (3)
msg410792 - (view) Author: Nikita Sobolev (sobolevn) * (Python triager) Date: 2022-01-17 14:57
Today I've noticed that these two methods are not covered: https://github.com/python/cpython/blame/16901c0482734dbd389b09ca3edfcf3e22faeed7/Lib/typing.py#L1028-L1032

- `typing._GenericAlias.__or__`
- `typing._GenericAlias.__ror__`

Later, I've realized that these two methods are not covered as well: https://github.com/python/cpython/blame/16901c0482734dbd389b09ca3edfcf3e22faeed7/Lib/typing.py#L1149-L1153

- `typing._SpecialGenericAlias.__or__`
- `typing._SpecialGenericAlias.__ror__`

My test plan is:
1. Cover regular `_GenericAlias` with `|` operation
2. Cover some `_SpecialGeneriAlias` instances like `Sized` and `Hashable`
3. Cover `Callable` and `Tuple` types, because they are a special-cased subtypes of `_SpecialGeneriAlias`

PR is on its way.
msg410957 - (view) Author: Ken Jin (kj) * (Python committer) Date: 2022-01-19 15:32
New changeset 0a49148e87cca11e3820cbff2abfd316986a68c6 by Nikita Sobolev in branch 'main':
bpo-46413: properly test `__{r}or__` code paths in `_SpecialGenericAlias` (GH-30640)
https://github.com/python/cpython/commit/0a49148e87cca11e3820cbff2abfd316986a68c6
msg410968 - (view) Author: miss-islington (miss-islington) Date: 2022-01-19 16:11
New changeset 39374c44d98b470213256ceead0e2b4e44b14b92 by Miss Islington (bot) in branch '3.10':
[3.10] bpo-46413: properly test `__{r}or__` code paths in `_SpecialGenericAlias` (GH-30640) (GH-30694)
https://github.com/python/cpython/commit/39374c44d98b470213256ceead0e2b4e44b14b92
History
Date User Action Args
2022-04-11 14:59:54adminsetgithub: 90571
2022-01-19 16:13:01kjsetstatus: open -> closed
stage: patch review -> resolved
resolution: fixed
versions: + Python 3.10
2022-01-19 16:11:21miss-islingtonsetmessages: + msg410968
2022-01-19 15:32:45miss-islingtonsetpull_requests: + pull_request28892
2022-01-19 15:32:41miss-islingtonsetnosy: + miss-islington
pull_requests: + pull_request28891
2022-01-19 15:32:36kjsetnosy: + kj
messages: + msg410957
2022-01-17 14:59:08sobolevnsetkeywords: + patch
stage: patch review
pull_requests: + pull_request28843
2022-01-17 14:57:56sobolevncreate