Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork33.7k
gh-103763: Implement PEP 695#103764
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
gh-103763: Implement PEP 695#103764
Changes from1 commit
9c8cd71609ac0d7a5e4571e0b74c2a5023a1bc8574ed42796d06f43d830b36ab6bf2bc6bb4795c7c1618772920f6ff6f5a9fdf373f7c513d1d7b03585a440955d0fd9618e173bef978f3cd026ab12663dbb9c43c037ddfaa62f0c29c7a153aa8ea68ab6b718dba4293e36c5f521e1b1a8505134338b97804bc911521bd81f2d91b0ccf68d96159d75d9c0d90d26b82a423d2defdd88772461ed5e9a196f536cf13c0b04e359e6fa05521c7db9d8fbbf3340c2b5de372fa81c017aeee08a7e6bcbfe8445834c024dd9ec56e6ab8b1ed916974b38dea48991bb1c3f520ae668ed82b844f447d24d98ad0b5b6312d7b48e23b0dec31ae062999c9147a4a1b043c816cb6a51bdfb75308c7c1ff22d22c4ce394f02199f3fe019b737d96a6fe947680a9efb21b3aec30487a51575c66a6045f02c8b4f166851e6be059c1ac7f7220f70925e17c3b045696ae02e0a8a7a8fc1471951625fbd4d5f86be9c77b3807f448248d32bc6127a8a4c44b9222445a39b7fa37b4880f0663d8e24e74c1a0dd5b86c53b6098d9632c028a0ecb70bb175a5e4ec0e12d30046c3f65a84a00cee0acb87d77c4fbea66c7cb314a3f2e913ca394d128bd49622bf45a8ece7fe9ce5a6c2196324a5fd0f7b4e784da172fc40c4b6a81593a4552b36b7afa85fb6c645402621667d9e65d668e0a0b04d5c44f5ce6a9902fc9cc73f719110891a6178a9ba2c0b45e116a037fc5d93780399ed4782fc35a0928960241da55b3a20478f3f4b9d3177bc52179cd0fa718f0936de5259096c3d6464f58058317c8060f4ea50043bcd02827b9e571cef7880ffbf3e7863822a8f0ef967f1004cbbd248dfb93d43f02700b35c6ca2f3c75c51b9fc047abba51a46555e68cd83b63b76281f575a3cd2e7a4f607688ac5dc32fc89c02f1fca249ca43645b08b17c30f60067e0039ace71a1c59f7f7e62198f54b02bb2df61fdf65ad4fecf7df8406cefd4fe5c0b94580e952d61785dd45be70e3c92c29e7529c74d531fcf7497e22abfb5ac0a1be61d1e9273cbc375793817ab4f2a93934f1223ed49025133f4c12b9f4540a64922f8a783b39e6658a0aad1f4a22a08f1328c757d6016e1401209e049f5ac4d9ec4b93f85ef412f49d4e72a508d931cFile filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
Rather than changing a bunch of stuff (and confusing the runtimeby having __annotate__ functions have *both* fast *and* slow locals)we're changing the approach. For delayed-evaluation expressions(e.g. __annotate__ in PEP 649) we're going to change the LOAD_NAMEopcodes we generate into LOAD_CLASS_DICT opcodes. Then when webind that function (e.g. an __annotate__ inside a class body) we'regoing to use the new INTRINSIC2 SET_CLASS_DICT opcode to set thenew func_class_dict field. LOAD_CLASS_DICT does its lookup inframe->f_funcobj->func_class_dict, so, we didn't make the frame larger!
- Loading branch information
Uh oh!
There was an error while loading.Please reload this page.
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -10,7 +10,6 @@ extern "C" { | ||
| #define COMMON_FIELDS(PREFIX) \ | ||
| PyObject *PREFIX ## globals; \ | ||
| PyObject *PREFIX ## builtins; \ | ||
| PyObject *PREFIX ## name; \ | ||
| PyObject *PREFIX ## qualname; \ | ||
| @@ -42,6 +41,7 @@ typedef struct { | ||
| PyObject *func_weakreflist; /* List of weak references */ | ||
| PyObject *func_module; /* The __module__ attribute, can be anything */ | ||
| PyObject *func_annotations; /* Annotations, a dict or NULL */ | ||
| PyObject *func_class_dict; /* Class dict, a dict or NULL */ | ||
| vectorcallfunc vectorcall; | ||
| /* Version number for use by specializer. | ||
| * Can set to non-zero when we want to specialize. | ||
| @@ -68,7 +68,7 @@ PyAPI_FUNC(PyObject *) PyFunction_New(PyObject *, PyObject *); | ||
| PyAPI_FUNC(PyObject *) PyFunction_NewWithQualName(PyObject *, PyObject *, PyObject *); | ||
| PyAPI_FUNC(PyObject *) PyFunction_GetCode(PyObject *); | ||
| PyAPI_FUNC(PyObject *) PyFunction_GetGlobals(PyObject *); | ||
| PyAPI_FUNC(PyObject *)PyFunction_GetClassDict(PyObject *); | ||
JelleZijlstra marked this conversation as resolved. OutdatedShow resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
| PyAPI_FUNC(PyObject *) PyFunction_GetModule(PyObject *); | ||
| PyAPI_FUNC(PyObject *) PyFunction_GetDefaults(PyObject *); | ||
| PyAPI_FUNC(int) PyFunction_SetDefaults(PyObject *, PyObject *); | ||
| @@ -101,10 +101,10 @@ static inline PyObject* PyFunction_GET_GLOBALS(PyObject *func) { | ||
| } | ||
| #define PyFunction_GET_GLOBALS(func) PyFunction_GET_GLOBALS(_PyObject_CAST(func)) | ||
| static inline PyObject*PyFunction_GET_CLASS_DICT(PyObject *func) { | ||
| return _PyFunction_CAST(func)->func_class_dict; | ||
| } | ||
| #definePyFunction_GET_CLASS_DICT(func)PyFunction_GET_CLASS_DICT(_PyObject_CAST(func)) | ||
| static inline PyObject* PyFunction_GET_MODULE(PyObject *func) { | ||
| return _PyFunction_CAST(func)->func_module; | ||
Some generated files are not rendered by default. Learn more abouthow customized files appear on GitHub.
Uh oh!
There was an error while loading.Please reload this page.
Some generated files are not rendered by default. Learn more abouthow customized files appear on GitHub.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.