mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
bpo-47067: Optimize calling GenericAlias objects (GH-31996)
Use vectorcall, and replace `PyObject_SetAttrString` with `PyObject_SetAttr` and a global string.
This commit is contained in:
parent
5c3201e146
commit
1ea055bd53
4 changed files with 35 additions and 7 deletions
|
@ -156,6 +156,7 @@ struct _Py_global_strings {
|
|||
STRUCT_FOR_ID(__next__)
|
||||
STRUCT_FOR_ID(__note__)
|
||||
STRUCT_FOR_ID(__or__)
|
||||
STRUCT_FOR_ID(__orig_class__)
|
||||
STRUCT_FOR_ID(__origin__)
|
||||
STRUCT_FOR_ID(__package__)
|
||||
STRUCT_FOR_ID(__parameters__)
|
||||
|
|
|
@ -779,6 +779,7 @@ extern "C" {
|
|||
INIT_ID(__next__), \
|
||||
INIT_ID(__note__), \
|
||||
INIT_ID(__or__), \
|
||||
INIT_ID(__orig_class__), \
|
||||
INIT_ID(__origin__), \
|
||||
INIT_ID(__package__), \
|
||||
INIT_ID(__parameters__), \
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue