summaryrefslogtreecommitdiffstats
path: root/Objects/genericaliasobject.c
diff options
context:
space:
mode:
authorJelle Zijlstra <jelle.zijlstra@gmail.com>2022-05-02 19:21:59 (GMT)
committerGitHub <noreply@github.com>2022-05-02 19:21:59 (GMT)
commitff88f7e007deb7a9f7539938dcf6f4adbfebf442 (patch)
treef6db3ea58a6b68abaacb2311461208849364b0e9 /Objects/genericaliasobject.c
parent56f98440148e4257aa5b27150ce2269c98cea0ea (diff)
downloadcpython-ff88f7e007deb7a9f7539938dcf6f4adbfebf442.zip
cpython-ff88f7e007deb7a9f7539938dcf6f4adbfebf442.tar.gz
cpython-ff88f7e007deb7a9f7539938dcf6f4adbfebf442.tar.bz2
gh-87390: Add __unpacked__ attribute to types.GenericAlias (#92059)
Diffstat (limited to 'Objects/genericaliasobject.c')
-rw-r--r--Objects/genericaliasobject.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/Objects/genericaliasobject.c b/Objects/genericaliasobject.c
index 7b68991..c6ed161 100644
--- a/Objects/genericaliasobject.c
+++ b/Objects/genericaliasobject.c
@@ -516,6 +516,7 @@ ga_vectorcall(PyObject *self, PyObject *const *args,
static const char* const attr_exceptions[] = {
"__origin__",
"__args__",
+ "__unpacked__",
"__parameters__",
"__mro_entries__",
"__reduce_ex__", // needed so we don't look up object.__reduce_ex__
@@ -657,6 +658,7 @@ static PyMethodDef ga_methods[] = {
static PyMemberDef ga_members[] = {
{"__origin__", T_OBJECT, offsetof(gaobject, origin), READONLY},
{"__args__", T_OBJECT, offsetof(gaobject, args), READONLY},
+ {"__unpacked__", T_BOOL, offsetof(gaobject, starred), READONLY},
{0}
};