GH-90699: use statically allocated interned strings in typeobject's slotdefs (GH-94706)

This commit is contained in:
Kumar Aditya 2022-09-08 03:32:08 +05:30 committed by GitHub
parent b65686c505
commit 4e4bfffe2d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 140 additions and 176 deletions

View file

@ -14,6 +14,7 @@ IGNORED = {
'DUNDER', # Objects/typeobject.c
'RDUNDER', # Objects/typeobject.c
'SPECIAL', # Objects/weakrefobject.c
'NAME', # Objects/typeobject.c
}
IDENTIFIERS = [
# from ADD() Python/_warnings.c
@ -42,11 +43,27 @@ IDENTIFIERS = [
# from SLOT* in Objects/typeobject.c
'__abs__',
'__add__',
'__aiter__',
'__and__',
'__divmod__',
'__anext__',
'__await__',
'__bool__',
'__call__',
'__contains__',
'__del__',
'__delattr__',
'__delete__',
'__delitem__',
'__eq__',
'__float__',
'__floordiv__',
'__ge__',
'__get__',
'__getattr__',
'__getattribute__',
'__getitem__',
'__gt__',
'__hash__',
'__iadd__',
'__iand__',
'__ifloordiv__',
@ -54,24 +71,34 @@ IDENTIFIERS = [
'__imatmul__',
'__imod__',
'__imul__',
'__index__',
'__init__',
'__int__',
'__invert__',
'__ior__',
'__ipow__',
'__irshift__',
'__isub__',
'__iter__',
'__itruediv__',
'__ixor__',
'__le__',
'__len__',
'__lshift__',
'__lt__',
'__matmul__',
'__mod__',
'__mul__',
'__ne__',
'__neg__',
'__new__',
'__next__',
'__or__',
'__pos__',
'__pow__',
'__radd__',
'__rand__',
'__rdivmod__',
'__repr__',
'__rfloordiv__',
'__rlshift__',
'__rmatmul__',
@ -84,10 +111,15 @@ IDENTIFIERS = [
'__rsub__',
'__rtruediv__',
'__rxor__',
'__set__',
'__setattr__',
'__setitem__',
'__str__',
'__sub__',
'__truediv__',
'__xor__',
'__divmod__',
'__rdivmod__',
]