[Python-checkins] Update test__opcode and _Py_GetSpecializationStats with recent specialization stat changes (GH-27728)

iritkatriel webhook-mailer at python.org
Wed Aug 11 12:34:11 EDT 2021


https://github.com/python/cpython/commit/64a7812c170f5d46ef16a1517afddc7cd92c5240
commit: 64a7812c170f5d46ef16a1517afddc7cd92c5240
branch: main
author: Irit Katriel <1055913+iritkatriel at users.noreply.github.com>
committer: iritkatriel <1055913+iritkatriel at users.noreply.github.com>
date: 2021-08-11T17:34:01+01:00
summary:

Update test__opcode and _Py_GetSpecializationStats with recent specialization stat changes (GH-27728)

files:
M Lib/test/test__opcode.py
M Python/specialize.c

diff --git a/Lib/test/test__opcode.py b/Lib/test/test__opcode.py
index f6d8c730645c19..6bbab539903ce6 100644
--- a/Lib/test/test__opcode.py
+++ b/Lib/test/test__opcode.py
@@ -82,10 +82,12 @@ def test_specialization_stats(self):
             self.assertCountEqual(stats.keys(), specialized_opcodes)
             self.assertCountEqual(
                 stats['load_attr'].keys(),
-                stat_names + ['fails'])
+                stat_names + ['specialization_failure_kinds'])
             for sn in stat_names:
                 self.assertIsInstance(stats['load_attr'][sn], int)
-            self.assertIsInstance(stats['load_attr']['specialization_failure_kinds'], tuple)
+            self.assertIsInstance(
+                stats['load_attr']['specialization_failure_kinds'],
+                tuple)
             for v in stats['load_attr']['specialization_failure_kinds']:
                 self.assertIsInstance(v, int)
 
diff --git a/Python/specialize.c b/Python/specialize.c
index d0e45d70c08801..f0d68f027d6464 100644
--- a/Python/specialize.c
+++ b/Python/specialize.c
@@ -122,6 +122,7 @@ _Py_GetSpecializationStats(void) {
     err += add_stat_dict(stats, LOAD_ATTR, "load_attr");
     err += add_stat_dict(stats, LOAD_GLOBAL, "load_global");
     err += add_stat_dict(stats, BINARY_SUBSCR, "binary_subscr");
+    err += add_stat_dict(stats, STORE_ATTR, "store_attr");
     if (err < 0) {
         Py_DECREF(stats);
         return NULL;



More information about the Python-checkins mailing list