Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitebf97c5

Browse files
authored
gh-103978: avoid using 'class' as an identifier (#103979)
1 parent83aa496 commitebf97c5

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

‎Include/internal/pycore_code.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ extern int _PyLineTable_PreviousAddressRange(PyCodeAddressRange *range);
226226

227227
/* Specialization functions */
228228

229-
externvoid_Py_Specialize_LoadSuperAttr(PyObject*global_super,PyObject*class,PyObject*self,
229+
externvoid_Py_Specialize_LoadSuperAttr(PyObject*global_super,PyObject*cls,PyObject*self,
230230
_Py_CODEUNIT*instr,PyObject*name,intload_method);
231231
externvoid_Py_Specialize_LoadAttr(PyObject*owner,_Py_CODEUNIT*instr,
232232
PyObject*name);

‎Python/specialize.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -515,7 +515,7 @@ specialize_module_load_attr(
515515
/* Attribute specialization */
516516

517517
void
518-
_Py_Specialize_LoadSuperAttr(PyObject*global_super,PyObject*class,PyObject*self,
518+
_Py_Specialize_LoadSuperAttr(PyObject*global_super,PyObject*cls,PyObject*self,
519519
_Py_CODEUNIT*instr,PyObject*name,intload_method) {
520520
assert(ENABLE_SPECIALIZATION);
521521
assert(_PyOpcode_Caches[LOAD_SUPER_ATTR]==INLINE_CACHE_ENTRIES_LOAD_SUPER_ATTR);
@@ -528,11 +528,11 @@ _Py_Specialize_LoadSuperAttr(PyObject *global_super, PyObject *class, PyObject *
528528
SPECIALIZATION_FAIL(LOAD_SUPER_ATTR,SPEC_FAIL_SUPER_SHADOWED);
529529
gotofail;
530530
}
531-
if (!PyType_Check(class)) {
531+
if (!PyType_Check(cls)) {
532532
SPECIALIZATION_FAIL(LOAD_SUPER_ATTR,SPEC_FAIL_SUPER_BAD_CLASS);
533533
gotofail;
534534
}
535-
PyTypeObject*tp= (PyTypeObject*)class;
535+
PyTypeObject*tp= (PyTypeObject*)cls;
536536
PyObject*res=_PySuper_LookupDescr(tp,self,name);
537537
if (res==NULL) {
538538
SPECIALIZATION_FAIL(LOAD_SUPER_ATTR,SPEC_FAIL_SUPER_ERROR_OR_NOT_FOUND);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp