Issue 45663: is_dataclass() does not work for dataclasses which are subclasses of types.GenericAlias (original) (raw)
Issue45663
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.
This issue has been migrated to GitHub: https://github.com/python/cpython/issues/89826
classification
Title: | is_dataclass() does not work for dataclasses which are subclasses of types.GenericAlias | ||
---|---|---|---|
Type: | behavior | Stage: | resolved |
Components: | Library (Lib) | Versions: | Python 3.11, Python 3.10, Python 3.9 |
process
Status: | closed | Resolution: | fixed |
---|---|---|---|
Dependencies: | Superseder: | ||
Assigned To: | Nosy List: | eric.smith, gvanrossum, miss-islington, serhiy.storchaka | |
Priority: | normal | Keywords: | patch |
Created on 2021-10-28 20:10 by serhiy.storchaka, last changed 2022-04-11 14:59 by admin. This issue is now closed.
Pull Requests | |||
---|---|---|---|
URL | Status | Linked | Edit |
PR 29294 | merged | serhiy.storchaka,2021-10-28 20:14 | |
PR 29925 | merged | miss-islington,2021-12-05 20:42 | |
PR 29926 | merged | miss-islington,2021-12-05 20:43 |
Messages (4) | ||
---|---|---|
msg405256 - (view) | Author: Serhiy Storchaka (serhiy.storchaka) * ![]() |
Date: 2021-10-28 20:10 |
>>> import dataclasses, types >>> @dataclasses.dataclass ... class A(types.GenericAlias): ... origin: type ... args: type ... >>> dataclasses.is_dataclass(A) True >>> a = A(list, int) >>> dataclasses.is_dataclass(type(a)) True >>> dataclasses.is_dataclass(a) False | ||
msg407739 - (view) | Author: Serhiy Storchaka (serhiy.storchaka) * ![]() |
Date: 2021-12-05 20:42 |
New changeset 446be166861b2f08f87f74018113dd98ca5fca02 by Serhiy Storchaka in branch 'main': bpo-45663: Fix is_dataclass() for dataclasses which are subclasses of types.GenericAlias (GH-29294) https://github.com/python/cpython/commit/446be166861b2f08f87f74018113dd98ca5fca02 | ||
msg407743 - (view) | Author: miss-islington (miss-islington) | Date: 2021-12-05 21:04 |
New changeset abceb66c7e33d165361d8a26efb3770faa721aff by Miss Islington (bot) in branch '3.10': bpo-45663: Fix is_dataclass() for dataclasses which are subclasses of types.GenericAlias (GH-29294) https://github.com/python/cpython/commit/abceb66c7e33d165361d8a26efb3770faa721aff | ||
msg407745 - (view) | Author: miss-islington (miss-islington) | Date: 2021-12-05 21:25 |
New changeset 19050711f5a68e50b942b3b7f1f4cf398f27efff by Miss Islington (bot) in branch '3.9': bpo-45663: Fix is_dataclass() for dataclasses which are subclasses of types.GenericAlias (GH-29294) https://github.com/python/cpython/commit/19050711f5a68e50b942b3b7f1f4cf398f27efff |
History | |||
---|---|---|---|
Date | User | Action | Args |
2022-04-11 14:59:51 | admin | set | github: 89826 |
2021-12-07 12:01:12 | serhiy.storchaka | set | status: open -> closedresolution: fixedstage: patch review -> resolved |
2021-12-05 21:25:54 | miss-islington | set | messages: + |
2021-12-05 21:04:37 | miss-islington | set | messages: + |
2021-12-05 20:43:01 | miss-islington | set | pull_requests: + <pull%5Frequest28150> |
2021-12-05 20:42:57 | miss-islington | set | nosy: + miss-islingtonpull_requests: + <pull%5Frequest28149> |
2021-12-05 20:42:54 | serhiy.storchaka | set | messages: + |
2021-10-29 08:41:23 | serhiy.storchaka | link | issue45665 dependencies |
2021-10-28 20:14:25 | serhiy.storchaka | set | keywords: + patchstage: patch reviewpull_requests: + <pull%5Frequest27557> |
2021-10-28 20:10:31 | serhiy.storchaka | create |