]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-102674: Remove _specialization_stats from Lib/opcode.py (#102685)
authorDong-hee Na <donghee.na@python.org>
Tue, 14 Mar 2023 20:20:14 +0000 (05:20 +0900)
committerGitHub <noreply@github.com>
Tue, 14 Mar 2023 20:20:14 +0000 (13:20 -0700)
It's not use except in a test, so move it there instead.

Lib/opcode.py
Lib/test/test__opcode.py

index 23529d87a09ef94357c9dc979700a8955e6c4ee1..d4a2d554cf67defca2c67f05fcb55d84b41f0b40 100644 (file)
@@ -377,14 +377,6 @@ _specializations = {
 _specialized_instructions = [
     opcode for family in _specializations.values() for opcode in family
 ]
-_specialization_stats = [
-    "success",
-    "failure",
-    "hit",
-    "deferred",
-    "miss",
-    "deopt",
-]
 
 _cache_format = {
     "LOAD_GLOBAL": {
index db831069c7aeb8b5b22d17bdf9aef4093a070e35..fb4ab15f7041ed981cdc17196b846ed642c3172a 100644 (file)
@@ -69,8 +69,7 @@ class OpcodeTests(unittest.TestCase):
 
 class SpecializationStatsTests(unittest.TestCase):
     def test_specialization_stats(self):
-        stat_names = opcode._specialization_stats
-
+        stat_names = ["success", "failure", "hit", "deferred", "miss", "deopt"]
         specialized_opcodes = [
             op.lower()
             for op in opcode._specializations